Giter Site home page Giter Site logo

onClick 方法不执行 about menujs HOT 8 CLOSED

github-laziji avatar github-laziji commented on August 16, 2024
onClick 方法不执行

from menujs.

Comments (8)

 avatar commented on August 16, 2024 1

最简单的解决方案:

使用 import Contextmenu from "vue-contextmenujs/dist/contextmenu.umd" 代替 import Contextmenu from "vue-contextmenujs

from menujs.

unull avatar unull commented on August 16, 2024

vue版本2.5.17
element-ui版本 2.4.6
本插件版本 1.3.13
debugger发现点击优先执行 item的close 方法
onPrintmenu(event) { this.$contextmenu({ items: [{ label: "打印(P)...", icon: "el-icon-printer", disabled: false, hidden: false, onClick: () => { console.info('fileUrl:', event); } }], event, minWidth: 100 }); }

同遇到这个问题,请问能够解决吗?

from menujs.

ldwqh0 avatar ldwqh0 commented on August 16, 2024

我也是,不知道什么原因

from menujs.

jbts6 avatar jbts6 commented on August 16, 2024

你的编译环境导致this.$style里面是空的,源码里是根据const menus = getElementsByClassName(this.$style.menu)来找元素的,所以先执行了$destory(),visible 变为了false,onClick也就不执行了。

方法一检查编译环境,方法二,改源码写死

from menujs.

xuyang60 avatar xuyang60 commented on August 16, 2024

请问编译环境如果检查,从哪几个方面入手? @fh345392977

from menujs.

jbts6 avatar jbts6 commented on August 16, 2024

请问编译环境如果检查,从哪几个方面入手? @fh345392977

我直接改的源码

from menujs.

 avatar commented on August 16, 2024

this.$style 对应下面的值:

<style module>
.menu,
.menu_item,
.menu_item__clickable,
.menu_item__unclickable {
  box-sizing: border-box;
}
</style>

需要配置 css modules

@xuyang60

from menujs.

GitHub-Laziji avatar GitHub-Laziji commented on August 16, 2024

1.4.9后不再使用<style module>

from menujs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.