From daec98b7390a4416fc64488754061b325325ab02 Mon Sep 17 00:00:00 2001 From: qiwei Date: Tue, 11 Oct 2022 17:56:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=9E=E6=80=A7=E8=A1=A8=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=A8=AA=E5=90=91=E6=BB=9A=E5=8A=A8=E6=9D=A1=20review=20by=20l?= =?UTF-8?q?uox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mapboxgl/attributes/Attributes.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mapboxgl/attributes/Attributes.vue b/src/mapboxgl/attributes/Attributes.vue index 525bb42f..3b1b0f30 100644 --- a/src/mapboxgl/attributes/Attributes.vue +++ b/src/mapboxgl/attributes/Attributes.vue @@ -54,6 +54,7 @@ :customHeaderRow="customHeaderRow" :customRow="customRow" :loading="loading" + :scroll="{ x: xScrollWidth }" :getPopupContainer="getPopupContainerFn" table-layout="fixed" @change="handleChange" @@ -204,6 +205,8 @@ class SmAttributes extends Mixins(MapGetter, Theme, VmUpdater) { fieldInfo: Array = []; + xScrollWidth: number = 0; + tableOptions: TableParams = { showHeader: true, showBorder: true, @@ -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; }