Quasar: [Request] QLayout: Default Sides State

Created on 27 Jul 2017  路  4Comments  路  Source: quasarframework/quasar

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.

All 4 comments

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

@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.

If it鈥檚 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.

Code ready in future v0.15 so closing this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xereda picture xereda  路  3Comments

mesqueeb picture mesqueeb  路  3Comments

adwidianjaya picture adwidianjaya  路  3Comments

tombarfoot picture tombarfoot  路  3Comments

alexeigs picture alexeigs  路  3Comments