vue在同一個組件內;
methods中的一個方法調用methods中的另外一個方法
可以在調用的時候 this.handleEdit();
methods: {
processEdit() {
if (this.multipleSelection.length === 0 ) {
this.$message( {
message: '請選擇要修改的記錄',
type: 'warning'
} )
} else if (this.multipleSelection.length > 1 ) {
this.$message( {
message: '只能選擇1個要修改的記錄',
type: 'warning'
} )
} else {
var row = this.multipleSelection[0];
this.handleEdit(0, row.id);
}
},
handleEdit(index, rowId){
this.$router.push(
{
path:'/Issuemag/' + this.$route.params.id + '/Issue/modify',
query:{rowId:rowId}
})
}
},