Skip to content

Commit daec98b

Browse files
属性表增加横向滚动条 review by luox
1 parent d46377f commit daec98b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/mapboxgl/attributes/Attributes.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
:customHeaderRow="customHeaderRow"
5555
:customRow="customRow"
5656
:loading="loading"
57+
:scroll="{ x: xScrollWidth }"
5758
:getPopupContainer="getPopupContainerFn"
5859
table-layout="fixed"
5960
@change="handleChange"
@@ -204,6 +205,8 @@ class SmAttributes extends Mixins(MapGetter, Theme, VmUpdater) {
204205
205206
fieldInfo: Array<Object> = [];
206207
208+
xScrollWidth: number = 0;
209+
207210
tableOptions: TableParams = {
208211
showHeader: true,
209212
showBorder: true,
@@ -312,6 +315,13 @@ class SmAttributes extends Mixins(MapGetter, Theme, VmUpdater) {
312315
@Watch('fieldConfigs', { immediate: true })
313316
fieldConfigsChanged(val) {
314317
if (!isequal(val, this.fieldInfo)) {
318+
let total = 0;
319+
val.forEach((item) => {
320+
let width = item.width ? item.width : 128;
321+
total += width;
322+
});
323+
// @ts-ignore
324+
this.xScrollWidth = total;
315325
// @ts-ignore
316326
this.fieldInfo = val;
317327
}

0 commit comments

Comments
 (0)