Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
973 views
in Technique[技术] by (71.8m points)

vuex mutations 怎么使用公用方法

input绑定v-model,先通过state赋值给v-model,修改后重新保存到v-model中, mutations里面写的保存方法,怎样使3个input框公用一个方法呢

clipboard.png
clipboard.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

使用展开运算符

  update (state, obj) {
    state.runner= {...state.runner, ...obj}
  }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...