Vue.js数据已更改,但视图未更改

时间:2018-09-13 07:16:24

标签: vue.js

我在数据中将对象定义为

export default {
  data() {
    return {
      labelPosition: 'right',
      isText: false,
      isDate: false,
      isExam: false,
      isFile: false,
      isWrite: false,
      stepLists: [],
      flowId: '',
      txtName: '',
      form: {
        textName: '',
        textPosition: '',
      }

这样的html: 当我更改form.textName时,我发现它不起作用

this.$set(this.form, 'textName', temp.name) //not work
 this.form={textName:'abc'}
 this.form = Object.assign({}, this.form)

 //not work

  this.$set(this.form,'textName', '---------------------') work well.

0 个答案:

没有答案