Using Store in Components
-
How Can I use vuex store in vue components… I don’t want to write this.$store.state… Can use just like store.state…
-
just use the mapState helper:
https://vuex.vuejs.org/guide/state.html#the-mapstate-helper -
@sebag thanks for your answer… it’s not only about this.$store.state… I just gave an example. It’s written in app.js file as follows in .quasar folder:
// Create the app instantiation Object.
// Here we inject the router, store to all child components,
// making them available everywhere asthis.$router
andthis.$store
.
const app = {
router,
store,
render: h => h(App)
}that means as far as I understand I can use in compenets only just ‘store.someThing’…