element-ui的this.$confirm和this.$message

confirmFn(){
          this.$confirm('确定要结束吗?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              alert(111);
            }).catch(() => {
            });
        //  this.$message({
        //   message: '复制成功',
        //   type: 'success',
        //   center:true
        //  });
     }
  },

在这里插入图片描述

在这里插入图片描述

this. d a t a : v m 上 的 数 据 t h i s . data: vm上的数据 this. data:vmthis.watch:监控
this. e l : 当 前 e l 元 素 t h i s . el:当前el元素 this. el:elthis.set:后加的属性实现响应式变化
this. n e x t T i c k : 异 步 方 法 , 等 待 渲 染 d o m 完 成 后 来 获 取 v m t h i s . nextTick :异步方法,等待渲染dom完成后来获取vm this. nextTick:domvmthis.store.commit(‘toShowLoginDialog’, true);
this.$store.dispatch(‘toShowLoginDialog’,false)

主要区别是:
dispatch:含有异步操作,例如向后台提交数据,写法:

this.$store.dispatch('mutations方法名',)

commit:同步操作,写法:

this.$store.commit('mutations方法名',)
  • 4
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值