inspector 插件里不能给 target.foo.value 赋值吗?不是双向绑定吗?

  • Creator 版本:
    2.3.3

  • 重现方式:

自定义 inspector 插件

// target 默认指向 Componet 自定义组件
Vue.component("property-curve", {
  // 修改组件在 inspector 的显示样式
  template: `
    <h2>test{{target.foo.value}}</h2>
    <ui-button @click="submit">submit</ui-button>
  `,
  props: {
    target: {
      twoWay: true,
      type: Object,
    },
  },
  methods: {
    submit() {
      console.log("submit -----=====");
      this.target.foo.value = "foooooo";
      console.log(this.target);
    },
  },
});

  1. foo 是 string 默认值为 abc
  2. 点击 submit 按钮
  3. foo 属性编辑器里的值,瞬间变成 foooooo 然后又变回 abc

问:不是双向绑定吗??
问:怎么在插件里给属性赋值?

  • 出现概率:

100%