Commit 78b7cd0b28268871d65c854f3de08e292283a4bd

Authored by Aresn
Committed by GitHub
2 parents 147f23a5 f99b7f64

Merge pull request #4377 from DophinL/split-panel-resize-bug

fix(split panel): fix issue #4376
Showing 1 changed file with 9 additions and 2 deletions   Show diff stats
src/components/split/split.vue
... ... @@ -155,17 +155,24 @@
155 155 on(document, 'mousemove', this.handleMove);
156 156 on(document, 'mouseup', this.handleUp);
157 157 this.$emit('on-move-start');
  158 + },
  159 + computeOffset(){
  160 + this.offset = (this.valueIsPx ? this.px2percent(this.value, this.$refs.outerWrapper[this.offsetSize]) : this.value) * 10000 / 100;
158 161 }
159 162 },
160 163 watch: {
161 164 value () {
162   - this.offset = (this.valueIsPx ? this.px2percent(this.value, this.$refs.outerWrapper[this.offsetSize]) : this.value) * 10000 / 100;
  165 + this.computeOffset()
163 166 }
164 167 },
165 168 mounted () {
166 169 this.$nextTick(() => {
167   - this.offset = (this.valueIsPx ? this.px2percent(this.value, this.$refs.outerWrapper[this.offsetSize]) : this.value) * 10000 / 100;
  170 + this.computeOffset()
168 171 });
  172 +
  173 + window.addEventListener('resize', ()=>{
  174 + this.computeOffset()
  175 + })
169 176 }
170 177 };
171 178 </script>
... ...