v-contextmenu icon indicating copy to clipboard operation
v-contextmenu copied to clipboard

Contextmenu mounted 钩子 this.$contextmenuId这个时候是不是undefined的哈

Open yunyi5310440 opened this issue 6 years ago • 2 comments

@snokier 看到 Contextmenu mounted 的代码的时候 有一点不明白 这里 this.$contextmenuId 应该都是undefined的吧 我看contextmenuId 都是在 指令 inserted的时候才赋值的 。

 mounted () {
      const elm = document.querySelector(this.containerSelector)

      elm.appendChild(this.$el)

      if (window.$$VContextmenu) {
        window.$$VContextmenu[this.$contextmenuId] = this
      } else {
        window.$$VContextmenu = { [this.$contextmenuId]: this }
      }
    },

yunyi5310440 avatar Mar 11 '19 02:03 yunyi5310440

你说的很对,想必这是个 bug

https://github.com/snokier/v-contextmenu/blob/master/src/components/Contextmenu.vue#L78 https://github.com/snokier/v-contextmenu/blob/master/src/directive.js#L4

CyberNika avatar Mar 11 '19 09:03 CyberNika

^_^ 希望作者可以尽快修复 我好可以基于您这个组件写一个自己的小东西

yunyi5310440 avatar Mar 14 '19 06:03 yunyi5310440