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:vm上的数据this.watch:监控
this.
e
l
:
当
前
e
l
元
素
t
h
i
s
.
el:当前el元素 this.
el:当前el元素this.set:后加的属性实现响应式变化
this.
n
e
x
t
T
i
c
k
:
异
步
方
法
,
等
待
渲
染
d
o
m
完
成
后
来
获
取
v
m
t
h
i
s
.
nextTick :异步方法,等待渲染dom完成后来获取vm this.
nextTick:异步方法,等待渲染dom完成后来获取vmthis.store.commit(‘toShowLoginDialog’, true);
this.$store.dispatch(‘toShowLoginDialog’,false)
主要区别是:
dispatch:含有异步操作,例如向后台提交数据,写法:
this.$store.dispatch('mutations方法名',值)
commit:同步操作,写法:
this.$store.commit('mutations方法名',值)