1

I am using nuxtjs to set custom theme on the basis of a specific value (eg:token,client_id etc) What I am facing, in nuxt layout context can't find the vuex.$store values. what can be done?

example code:

layout(ctx) {
      console.log(ctx.theme_val)
      return this.$store.state.theme_val == 2 ? 'bg1' : 'bg2'

    }

1 Answer 1

1

You need to get store from a context.

layout(ctx) {
   return ctx.store.state.theme_val == 2 ? 'bg1' : 'bg2'
}
Sign up to request clarification or add additional context in comments.

1 Comment

thanks for the answer. Today I have reached to max upvote limit. I'll up u next day. thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.