 
   
<el-table-column align="center" prop="mobile" label="操作">
    <template slot-scope="{ row }">
        <el-button type="text" @click="shutShop(row)" >关店</el-button>
    </template>
</el-table-column>
// 关闭店铺
    shutShop(row) {
      this.$prompt("请描述关店原因", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        inputType: "textarea",
        inputValidator: (val) => { // value文本的判断
          if (!(val && val !== "")) {
            return "描述内容不能为空";
          }
          return true;
        },
      })
        .then(({ value }) => {
          // 输入原因
          this.onSuccess(row, value);
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消操作",
          });
        });
    },
    onSuccess(row, value) {
      console.log(row, value);
    },
    点击确定提示
    
     描述内容不能为空
    
    
     
   
 
版权声明:本文为Wang_MengHan原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
