-
-
Notifications
You must be signed in to change notification settings - Fork 775
Closed
Labels
Description
// 自定义列组件
Vue.component('table-operation', {
template: `<span>
<a href="" @click.stop.prevent="update(rowData,index)">编辑</a>
<a href="" @click.stop.prevent="deleteRow(rowData,index)">删除</a>
</span>`,
props: {
rowData: {
type: Object
},
field: {
type: String
},
index: {
type: Number
}
},
methods: {
update () {
var rowData = this.rowData;
var $Modal = this.$Modal;
var options = {
show: true,
heigt: 500,
width: 450,
title: '编辑',
component: {
name: 'edittr',
data: rowData
},
buttons: [
{
text: '确定',
action: function(){
alert(rowData.name);
}
},
{
text: '取消',
action: function(){
$Modal.close(d)
}
}
]
}
var d = $Modal.dialog(options)
},
deleteRow () {
var rowData = this.rowData;
this.$Modal.confirm('确定要删除数据吗?', function(v){
if(v){
alert(rowData.name)
//后台删除数据
//这里怎么获得table对象来操作
}
})
}
}
})这里的deleteRow 方法, 后台删除数据后,怎么刷新表格?