优化:切换布局时触发 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) {
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']),

Loading…
Cancel
Save