javascript - 当元素被禁用时 v-tooltip 停止工作

标签 javascript vue.js v-tooltip

<button v-tooltip="'text'" :disabled=true>Some button</button>

我需要 tooltip解释为什么按钮被禁用,但是当我这样做时,tooltip也被禁用了。

最佳答案

From this issue on the project :

The point with this is, that it's actually not an issue related to v-tooltip, but a browser-specification. Depending on the browser you use, some might and some other might not emit events for disabled elements. In this case, Firefox seems to emit events for disabled buttons and chrome doesn't.

As a workaround you might wrap the button in a div to be able to use v-tooltip on it.


例子

<div v-tooltip="'text'"><button :disabled=true>Some button</button></div>

关于javascript - 当元素被禁用时 v-tooltip 停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53748739/

相关文章:

javascript - 如何在不将整个类放入闭包的情况下使用 YUI 混淆全局变量

javascript - 我可以从一个 Vue.js 组件导出两个对象吗?

javascript - v-for 循环项目不会立即在 Vue 中更新

javascript - 如何在 Vue.js 中有条件地显示工具提示?

javascript - JS 脚本在 HTML 中的位置

javascript - 将文本放置在 d3 中的形状上

javascript - 如何在内部 v-tooltip 悬停时关闭外部 v-tooltip

javascript - 拉斐尔.JS : How drag and drop image dom elements in raphael paper

javascript - 多次触发全局混合 - Vue