宽度改变时改变导航栏宽度,这次真不自测了。。。我要睡了。。。
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-aside>
|
||||
<RightResize v-model="rightAsideWidth" v-show="leftCollapse"></RightResize>
|
||||
<RightResize v-model="rightAsideWidth" @change="rightAsideWidthChange" v-show="leftCollapse"></RightResize>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<i class="el-icon-fold el-icon-s-fold" v-if="leftCollapse" @click="turnLeftCollapse"></i>
|
||||
@@ -359,6 +359,9 @@
|
||||
}
|
||||
this.choiceSpace = spaceId;
|
||||
this.doGetPageList(null);
|
||||
},
|
||||
rightAsideWidthChange(width) {
|
||||
this.$store.commit('global/setRightAsideWidth', width);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
this.rightAsideWidth = 300;
|
||||
}
|
||||
this.$emit('input', this.rightAsideWidth);
|
||||
this.$emit('change', this.rightAsideWidth);
|
||||
}
|
||||
};
|
||||
document.onmouseup = () => {
|
||||
|
||||
@@ -2,6 +2,7 @@ export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
pageTabNameMap: {},
|
||||
rightAsideWidth: 0,
|
||||
},
|
||||
getters: {
|
||||
getPageTabNameMap(state) {
|
||||
@@ -14,5 +15,8 @@ export default {
|
||||
sameObj[item.key] = item.val;
|
||||
state.pageTabNameMap = sameObj;
|
||||
},
|
||||
setRightAsideWidth(state, rightAsideWidth) {
|
||||
state.rightAsideWidth = rightAsideWidth;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,14 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
navigationWidth: '100px'
|
||||
navigationWidth: '100px',
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.global.rightAsideWidth'() {
|
||||
this.computeNavigationWidth();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.onresize = () => {
|
||||
this.computeNavigationWidth();
|
||||
|
||||
Reference in New Issue
Block a user