Nova access to the vuex data from a custom tool Hey,
There is a way to access the vuex data in a custom tool? I tried it but with no luck. Maybe I'm missing something.
What I'm thinking it's to create a endpoint from where I can get the curent user data.
Tell me your opinion on this.
Thanks.
I believe you can access it through this.$store in your Tool.vue file
@bobbybouwmann you have access to it but if you refresh the page you will lose the state. The way you can access it it's like this
let user = this.$page.props.currentUser;
@mihaisolomon Well, it is JavaScript. If you refresh you lose the state for sure. You probably have to commit the state to the store I guess. Maybe you can see how Nova itself is doing that in the code
I have this.$store but for some reason what I need to access it's null
export default {
computed: {
},
created() {
console.log(this.$store.getters['currentUser']);
},
mounted() {
console.log(this.$store.getters['currentUser']);
},
}
I'm missing something?
Please sign in or create an account to participate in this conversation.