一、this.$alert

参数:

        1. 提示框的内容

        2. 提示框的标题

        3. confirmButtonText是按钮的名称

        4. 点击确定后的回调函数

this.$alert(res.msg, "温馨提示", {
     confirmButtonText: "确定",
     callback: action => {
        this.$router.go(0);
     }
});

 二、this.$confirm

参数:

        1. 提示框的内容

        2. 提示框的标题

        3. confirmButtonText是确认按钮的名称

        4. cancelButtonText是取消按钮的名称

        5. type是消息类型,可以为successerrorinfowarning

this.$confirm(res.data, '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
              showCancelButton: false,  //是否显示取消按钮
              showClose: false, //是否显示右上角的x
              closeOnClickModal: true, //是否可以点击空白处关闭弹窗
            })
              .then(() => {
                // this.$message({
                //   type: 'success',
                //   message: '删除成功!'
                // });
              })
              .catch(() => {
                // this.$message({
                //   type: 'info',
                //   message: '已取消删除'
                // });
              });

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐