1.成功提示
this.$message.success("恭喜你,这是一条成功消息");
2.错误提示
this.$message.error("错了哦,这是一条错误消息");
3.警告提示
this.$message.warning("警告哦,这是一条警告消息");
3.普通提示
this.$message("这是一条消息提示");
4.在js文件中使用Message消息提示
import { Message } from "element-ui";//js文件使用element-ui消息提示
Message.warning("登录状态过期,请重新登录!");
5.确认消息弹框
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$message({
type: "success",
message: "点击确定时调用的方法!",
});
})
.catch(() => {
this.$message({
type: "info",
message: "点击取消时调用的方法",
});
});