优化:切换布局时触发 resize 事件,以解决部分页面响应时布局问题;

optimize: resize event is triggered when switching layout to solve the layout problem when part of the page responds;
master
chenghongxing 4 years ago
parent a5c34a8514
commit 0c41878174
  1. 5
      src/App.vue

@ -43,10 +43,13 @@ export default {
'theme.color': function(val) { 'theme.color': function(val) {
let closeMessage = this.$message.loading(`您选择了主题色 ${val}, 正在切换...`) let closeMessage = this.$message.loading(`您选择了主题色 ${val}, 正在切换...`)
themeUtil.changeThemeColor(val, this.theme.mode).then(closeMessage) themeUtil.changeThemeColor(val, this.theme.mode).then(closeMessage)
},
'layout': function() {
window.dispatchEvent(new Event('resize'))
} }
}, },
computed: { computed: {
...mapState('setting', ['theme', 'weekMode', 'lang']) ...mapState('setting', ['layout', 'theme', 'weekMode', 'lang'])
}, },
methods: { methods: {
...mapMutations('setting', ['setDevice']), ...mapMutations('setting', ['setDevice']),

Loading…
Cancel
Save