Reputation: 426
Is it possible to switch the layout dynamically with a button?
I've tried different methods, but none of them worked.
data(){
return {
layoutName: 'default'
}
},
layout: this.layoutName
and I tried to use Vuex too
layout: this.$store.state.layoutName
Upvotes: 2
Views: 2041
Reputation: 426
I figured out. In Nuxt you can change the layout programmatically by using this method:
this.$nuxt.setLayout('Layout_Name')
Upvotes: 2