parentMethods(myId) {
var aObj = $("#myDiv");
htmlStr += '<spa onClick="view('+"'"+myId+"'"+')" title="新增下一级">添加子规则</span>'+
'<span onClick="edit('+"'"+myId+"'"+')">修改</span>'+
'<span onClick="del('+"'"+myId+"'"+')">删除</span>';
aObj.append(htmlStr);
},
view(id){
alert('查看:'+id)
},
edit(id){
alert('修改:'+id)
},
del(id){
alert('删除:'+id)
},
...
created:function(){
var that = this;
window.view = that.view;
window.edit = that.edit;
window.del = that.del;
}
vue中动态加载事件的使用
最新推荐文章于 2024-07-26 10:57:21 发布