Vue框架 elementUi之消息提醒和弹窗

1.重复多次的消息提醒
this. m e s s a g e . c l o s e A l l ( ) ; t h i s . message.closeAll(); this. message.closeAll();this.message({
type: ‘success’,
message: ‘删除成功!’
});

this. n o t i f y . c l o s e A l l ( ) ; t h i s . notify.closeAll(); this. notify.closeAll();this.notify({
title: ‘提示’,
message: ‘这是一条不会自动关闭的消息’,
duration: 0
});

2.关于禁用回车键的确认提醒按钮

this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning',
      beforeClose: (action, instance, done) => { // 取消回车确认事件
		 // console.log('进入beforeClose事件');
		   if (action === 'confirm') {
		      // console.log('进入 action === confirm 条件');
		       instance.$refs['confirm'].$el.onclick = function (e) {
		          // console.log('进入点击事件');
		           e = e || window.event;
		           if (e.detail !== 0) {
		               done();
		           }
		       }();
		   } else {
		       done();
		   }
		}
    }).then(() => {
      this.$message({
        type: 'success',
        message: '删除成功!'
      });
    }).catch(() => {
      this.$message({
        type: 'info',
        message: '已取消删除'
      });          
    });

你可能感兴趣的:(VUE)