Avue form表单联动

新增或修改的form中,其中一项改变会影响另一项的属性,那么可以使用以下方式

watch: {
    'form.category'() {
      const category = func.toInt(this.form.category);
      this.$refs.crud.option.column.filter(item => {
        if (item.prop === "path") {
          item.rules[0].required = category === 1;
        }
        if (item.prop === 'isOpen') {
          item.disabled = category === 2;
        }
      });
    },
  },

猜你喜欢

转载自blog.csdn.net/hyupeng1006/article/details/128098374