VUE ELEMENT-UI无法用右上角的“X”关闭,取消按钮可用

VUE ELEMENT-UI无法用右上角的“X”关闭,取消按钮可用

原因:清空方式有问题

我定义的要打开的表单:

      addElementForm: {
        title: "配置产品要素",
        dialogFormVisible: false,
        prod_name: [],
        prod_code: [],
        userName: [],
        date: [],
        zs_prod_info_id: [],
        shine_upon: [],
      },

打开前清空:

addElement_open(row) {
      this.addElementForm = [];
      this.addElementForm.dialogFormVisible = true;
      this.queryProdElement();
    },

改进:

新增一个清除方法

    addElement_clear(){
      this.addElementForm.prod_name = [],
      this.addElementForm.prod_code = [],
      this.addElementForm.userName = [],
      this.addElementForm.date = [],
      this.addElementForm.zs_prod_info_id = [],
      this.addElementForm.shine_upon = []
    },
addElement_open(row) {
      this.addElement_clear()
      this.addElementForm.dialogFormVisible = true;
      this.queryProdElement();
    },
posted @ 2023-05-10 11:23  Dinesaw  阅读(502)  评论(0编辑  收藏  举报