quasar icon indicating copy to clipboard operation
quasar copied to clipboard

[Request] QLayout: Default Sides State

Open jyan-zarate opened this issue 9 years ago • 4 comments

There should be props to define the default state of the left/right panels/sides.

Currently in v0.14, if you don't want the panels open by default you need to add ref="layout" to your <q-layout> and call this.$refs.layout.hideLeft() or this.$refs.layout.hideRight() in your mounted() function. (or use the v-model prop and add the sides obj to your data())

There should instead props for QLayout called defaultLeft & defaultRight, where (following the rules of the v-model prop) true means visible, while false means hidden. This of course be incompatible with the v-model prop.

This would not change existing behavior, because defaultLeft & defaultRight would default to true.

jyan-zarate avatar Jul 27 '17 00:07 jyan-zarate

And what is different from v-model where you set them to false in data?

pdanpdan avatar Jul 27 '17 03:07 pdanpdan

@pdanpdan Nothing other than it being quicker & clearer to set the desired behavior for the layout where you design the layout. I think you're being rhetorical to make me think that this can already be done, but I did mention that you can achieve the desired affect with the v-model prop in the original message.

jyan-zarate avatar Jul 27 '17 14:07 jyan-zarate

If it’s not only quicker to code but also results in cleaner code that is easier to understand (when you read it x months later), then count me as +1 too.

spectrolite avatar Jul 27 '17 15:07 spectrolite

Code ready in future v0.15 so closing this.

rstoenescu avatar Oct 26 '17 20:10 rstoenescu