fix(split panel): fix issue #4376

This commit is contained in:
刘宗源 2018-08-27 19:43:18 +08:00
parent 147f23a50b
commit f99b7f64c1

View file

@ -155,17 +155,24 @@
on(document, 'mousemove', this.handleMove);
on(document, 'mouseup', this.handleUp);
this.$emit('on-move-start');
},
computeOffset(){
this.offset = (this.valueIsPx ? this.px2percent(this.value, this.$refs.outerWrapper[this.offsetSize]) : this.value) * 10000 / 100;
}
},
watch: {
value () {
this.offset = (this.valueIsPx ? this.px2percent(this.value, this.$refs.outerWrapper[this.offsetSize]) : this.value) * 10000 / 100;
this.computeOffset()
}
},
mounted () {
this.$nextTick(() => {
this.offset = (this.valueIsPx ? this.px2percent(this.value, this.$refs.outerWrapper[this.offsetSize]) : this.value) * 10000 / 100;
this.computeOffset()
});
window.addEventListener('resize', ()=>{
this.computeOffset()
})
}
};
</script>