出错的模板代码:
this.$Modal.confirm({
title : '删除确认',
content : '确定要删除选中的记录?',
onOk : function (){
axios.post('../../mgr/${pathName}/delete', ${pk.attrname}s)
.then(function (value) {
this.$Message.info({
content : "删除成功"
});
vm.reload();
})
.catch(function (error) {
this.$Message.error(error);
})
}}
正确的模板代码:
this.$Modal
.confirm({
title : '删除确认',
content : '确定要删除选中的记录?',
onOk : function (){
axios.post('../../mgr/${pathName}/delete', ${pk.attrname}s)
.then(function (value) {
this.$Message
.info({
content : "删除成功"
});
vm.reload();
})
.catch(function (error) {
this.$Message
.error(error);
})
}
});
记得\$Message后面要加换行符就行了