electron 오른쪽 단추 메뉴 만들기

1063 단어
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());

        },

좋은 웹페이지 즐겨찾기