yansern / vue-multipane

Resizable split panes for Vue.js.
https://yansern.github.io/vue-multipane/
Other
588 stars 125 forks source link

Persist and restore resized size #30

Open novecento opened 3 years ago

novecento commented 3 years ago

Hi, it could be possible to save new size chosen by user, and restore it when user reenter on website? Thanks

PeterVri commented 3 years ago

@novecento, the option is already there.

1 in <multipane @paneResizeStop="storePaneWidths" > 2 then a method that stores the width % in localstorage or db storePaneWidths (pane, resizer, size) { localStorage.widthofthediv = size } 3 have the width like this :style="{width: this.widthofthediv, maxWidth: '70%'}" 4 in mounted, load the width from localstorage or db to widthofthediv