How to write listener when using avue-crud component

 1. Add the attribute v-model="form" to the tag

 <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      v-model="form"
    >
</avue-crud>

2. Add form to data, so that the monitoring mechanism of vue can monitor the changes of form

export default {
  data() {
    return {
      form: {},
}
}
}

3. Write the monitoring of a certain variable, the value that this.form can get is the value in the newly added pop-up window or the value in the pop-up window when editing; the first parameter is the new value, and the second parameter is the old value

  watch: {
    "form.category"(val,oldval) {
        //函数体
    },
  },

Guess you like

Origin blog.csdn.net/weixin_45294459/article/details/126730474