Skip to content

Commit

Permalink
刷新页面里渲染两次
Browse files Browse the repository at this point in the history
  • Loading branch information
rongxingsun committed Nov 7, 2018
1 parent 5485cf7 commit 931e5fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/layout/header-aside/components/header-size/index.vue
Expand Up @@ -33,7 +33,11 @@ export default {
// 注意 这里是关键
// 因为需要访问 this.$ELEMENT 所以只能在这里使用这种方式
value: {
handler (val) {
handler (val, oldVal) {
if (!oldVal) {
// 旧值为空是时设置 element 全局尺寸
this.$ELEMENT.size = this.value
}
if (this.$ELEMENT.size !== val) {
// 设置 element 全局尺寸
this.$ELEMENT.size = val
Expand Down

0 comments on commit 931e5fa

Please sign in to comment.