第一种写法:
/**
* 上架
*/
grounding (row) {
let _this = this;
this.$confirm('是否确认上架该数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
return getTopNext(row.id,null,1,store.getters.userInfo.userId);
}).then(data => {
_this.page.currentPage = 1;
_this.getList(this.page);
_this.showToal('提示', '上架成功', 'success');
})
},
上面得写法可以点击上架之后提示警告:
点击确定之后,才会提示上架成功
第二种写法:
/**
* 上架
*/
grounding (row) {
let _this = this;
this.$confirm('是否确认上架该数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
getTopNext(row.id,null,1,store.getters.userInfo.userId).then(data => {
_this.page.currentPage = 1;
_this.getList(this.page);
_this.showToal('提示', '上架成功', 'success');
})
},
这种写法会导致,在出现警告框的时候,就会提示上架成功。