layim-contextmenu layim 右键菜单
【 点我 】
- 先引入 contextmenu ,然后 var menu = layui.contextmenu ;
- 调用
layim.on('ready', function(options) {
menu.init([{
target: '.layim-list-friend',
menu: [{
text: "新增分组",
callback: function(target) {
layer.msg(target.find('span').text());
}
}]
},
{
target: '.layim-list-friend >li>h5>span',
menu: [{
text: "重命名",
callback: function(target) {
layer.msg(target.find('span').text());
}
},
{
text: "删除分组",
callback: function(target) {
layer.msg(target.find('span').text());
}
}]
}]);
});
- 2019-09-28
- 代码优化
- 可一次性渲染多个右键菜单
- 修复已知 bug
- 2017-10-8
M-finder