提交 2d7b470a 编写于 作者: tony001's avatar tony001

增加上下文菜单是否阻止默认绘制上下文菜单逻辑

上级 1143c3c5
......@@ -92,6 +92,14 @@ export default class ContextMenu extends Vue {
*/
@Prop()
public menus?: any[]
/**
* 是否阻止默认绘制上下文菜单
*
* @type {any}
* @memberof ContextMenu
*/
@Prop({default:false})
public isBlocked?:any;
/**
* 显示右键菜单
......@@ -195,7 +203,10 @@ export default class ContextMenu extends Vue {
if (contextRef) {
contextRef.oncontextmenu = (event: MouseEvent) => {
event.preventDefault();
this.showContextMenu(event.clientX, event.clientY);
if(!this.isBlocked){
this.showContextMenu(event.clientX, event.clientY);
}
this.$emit("showContext",event);
};
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册