0๐
@Terry you got it! Thanks!
<v-text-field
v-model.trim="getName">{{ getName }}</v-text-field>
data: () => ({ name: '' })
computed: {
getName: {
get: function() {
return this.$store.state.name
},
set: function(newValue) {
this.name = newValue
}
}
methods: {
submit() {
if(!this.name) {
this.name = this.$store.state.name
}
this.$store.dispatch('updateMe', {
name: this.name,
});
}
export default new Vuex.Store({
state: {
name: null,
}
- [Vuejs]-Cannot make Vue route with param to work with component
- [Vuejs]-I can't uninstall vue from ubuntu
Source:stackexchange.com