feat(Progress): add resize method #5161

This commit is contained in:
chenjiahan
2020-10-29 22:46:03 +08:00
parent 9be853f7ac
commit 2924004dd3
5 changed files with 55 additions and 5 deletions
+5 -4
View File
@@ -30,16 +30,17 @@ export default createComponent({
},
mounted() {
this.setWidth();
this.resize();
},
watch: {
showPivot: 'setWidth',
pivotText: 'setWidth',
showPivot: 'resize',
pivotText: 'resize',
},
methods: {
setWidth() {
// @exposed-api
resize() {
this.$nextTick(() => {
this.progressWidth = this.$el.offsetWidth;
this.pivotWidth = this.$refs.pivot ? this.$refs.pivot.offsetWidth : 0;