0👍
In setup function you access state or getter with computed :
computed(() => store.state.tenantLocale.timezone)
0👍
You can do like this
import { computed } from 'vue'
import { useStore } from 'vuex'
export default {
setup () {
const store = useStore()
return {
// access a state in computed function
timezone: computed(() => store.state.tenantLocale.timezone),
}
}
}
Source:stackexchange.com