Skip to content

Commit

Permalink
属性表增加横向滚动条 review by luox
Browse files Browse the repository at this point in the history
  • Loading branch information
xilanhuaweidapao committed Oct 12, 2022
1 parent d46377f commit daec98b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/mapboxgl/attributes/Attributes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
:customHeaderRow="customHeaderRow"
:customRow="customRow"
:loading="loading"
:scroll="{ x: xScrollWidth }"
:getPopupContainer="getPopupContainerFn"
table-layout="fixed"
@change="handleChange"
Expand Down Expand Up @@ -204,6 +205,8 @@ class SmAttributes extends Mixins(MapGetter, Theme, VmUpdater) {
fieldInfo: Array<Object> = [];
xScrollWidth: number = 0;
tableOptions: TableParams = {
showHeader: true,
showBorder: true,
Expand Down Expand Up @@ -312,6 +315,13 @@ class SmAttributes extends Mixins(MapGetter, Theme, VmUpdater) {
@Watch('fieldConfigs', { immediate: true })
fieldConfigsChanged(val) {
if (!isequal(val, this.fieldInfo)) {
let total = 0;
val.forEach((item) => {
let width = item.width ? item.width : 128;
total += width;
});
// @ts-ignore
this.xScrollWidth = total;
// @ts-ignore
this.fieldInfo = val;
}
Expand Down

0 comments on commit daec98b

Please sign in to comment.