// 在从组件的computed中
computed: {
    user: {
        get() {
          return this.$store.state.user
        },
        set(v) {
          // 使用vuex中的mutations中定义好的方法来改变
          this.$store.commit('USER', v)
        }
    }
}
// 在组件中就可以使用

<input v-modle="user" />

  

相关文章:

  • 2021-10-26
  • 2022-12-23
  • 2021-06-20
  • 2021-12-09
  • 2021-08-24
  • 2021-07-10
  • 2022-12-23
猜你喜欢
  • 2021-12-24
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2017-11-30
相关资源
相似解决方案