I am attempting to simplify the explanation as much as possible. The structure I have includes a basic Vue root, Vuex store, and an input with v-model inside the navbar id.
However, it seems that the input is not reactive... Why is that?
https://i.sstatic.net/v4ukJ.png
https://i.sstatic.net/v4ukJ.png
Snippet of HTML code:
<div id="navbar">
<h2>@{{ test }}</h2>
<input v-model="test" />
</div>
store.js content:
import Vuex from 'vuex'
export const store = new Vuex.Store({
state: {
test: 'test'
},
getters: {
test (state) {
return state.test
}
}
})
Vue Root setup:
import { store } from './app-store.js'
new Vue({
el: '#navbar',
store,
computed: {
test () {
return this.$store.getters.test
}
}
})