From 7a7d7070c4273b371e7cbde0476d47051383d995 Mon Sep 17 00:00:00 2001 From: hanshaozhuang Date: Tue, 5 Jul 2022 11:25:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug=2056037=20=E3=80=90WELINK?= =?UTF-8?q?=E3=80=91=E6=A0=87=E5=87=86=E5=BE=81=E6=B1=82=E6=84=8F=E8=A7=81?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=EF=BC=8C=E6=84=8F=E8=A7=81=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E8=8A=82=E7=82=B9=EF=BC=8C=E8=A1=A8=E6=A0=BC=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/App.vue b/src/App.vue index 6f9e8d55e..0f854550a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -92,7 +92,32 @@ export default { isBoolean: false } }, + created() { + let _this = this; + //窗口改变时 + window.onresize = function () { + _this.handleRefreshTable(); + }; + }, + updated() { + this.handleRefreshTable() + }, methods: { + handleRefreshTable() { + this.$nextTick(() => { + // 获取页面中已注册过ref的所有的子组件。 + let refList = this.$refs.appView.$refs; + if (refList) { + for (let i of Object.keys(refList)) { + // 根据doLayout方法判断子组件是不是el-table + if (refList[i] && refList[i].doLayout) { + // 执行doLayout方法 + refList[i].doLayout(); + } + } + } + }) + }, // 点击下拉选项事件 handleCommand(command) { // 退出登录 @@ -227,6 +252,8 @@ export default { } else { this.isBoolean = false } + //切换标签时 + this.handleRefreshTable(); } }, mounted() {