• electron 创建右键菜单


    1、引入模块
        const Electron = require('electron');
        const remote = Electron.remote;
        const Menu = remote.Menu;
        const MenuItem = remote.MenuItem;
    
    2、 
      data() {
            return {
                isShowMember:false,
                menu:null,
            }
        },
    
    
     created() {
            this.targetId = this.id;
            notificationCenter.on("onClosePop", this.onClosePop);
            this.initMenu();
       },
    
    3、methods: {
            //初始化右键菜单
            initMenu(){
                this.menu = new Menu();
                let that = this;
                this.menu.append(new MenuItem({ label: '删除', click: function() {
                    //删除本地文件.
                    that.imServices.deleteLocationMsgFiles(that.rightMessage);
                    //删除消息
                    that.imServices.removeMessages(that.rightMessage.peer, that.rightMessage.msgID);
                    that.rightMenuMsg(that.rightMessage);
                } }));
            },
    
    
      rightShow(item) {
                this.rightMessage = item;
                this.menu.popup(remote.getCurrentWindow());
    
            },
    
  • 相关阅读:
    Hadoop
    Mapreduce
    ssh原理
    HDFS
    Centos
    创建jira插件
    新型的领导者是一名推动者,而不是一名发号施令者
    上善若水,虚怀若谷
    GoAhead 嵌入式web
    Eclipse基金会
  • 原文地址:https://www.cnblogs.com/sxz2008/p/7529055.html
Copyright © 2020-2023  润新知