From 0c41878174e8e06462ee885825b9bfcfb8ba53f3 Mon Sep 17 00:00:00 2001 From: chenghongxing <1126263215@qq.com> Date: Tue, 12 Jan 2021 11:45:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E6=97=B6=E8=A7=A6=E5=8F=91=20resize=20?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=EF=BC=8C=E4=BB=A5=E8=A7=A3=E5=86=B3=E9=83=A8?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E9=9D=A2=E5=93=8D=E5=BA=94=E6=97=B6=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E9=97=AE=E9=A2=98=EF=BC=9B=20optimize:=20resize=20eve?= =?UTF-8?q?nt=20is=20triggered=20when=20switching=20layout=20to=20solve=20?= =?UTF-8?q?the=20layout=20problem=20when=20part=20of=20the=20page=20respon?= =?UTF-8?q?ds;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index 7e5ea74..31e6587 100644 --- a/src/App.vue +++ b/src/App.vue @@ -43,10 +43,13 @@ export default { 'theme.color': function(val) { let closeMessage = this.$message.loading(`您选择了主题色 ${val}, 正在切换...`) themeUtil.changeThemeColor(val, this.theme.mode).then(closeMessage) + }, + 'layout': function() { + window.dispatchEvent(new Event('resize')) } }, computed: { - ...mapState('setting', ['theme', 'weekMode', 'lang']) + ...mapState('setting', ['layout', 'theme', 'weekMode', 'lang']) }, methods: { ...mapMutations('setting', ['setDevice']),