【发布时间】:2021-08-13 14:23:26
【问题描述】:
我一直在尝试将tooltip 添加到仅在满足某些条件时才显示的按钮。我正在使用 uikit@3.0.0-beta.35。根据文档,我应该在 beforeshow 事件上返回 false。
UIkit.tooltip($element, { pos: 'top' });
$element.on('beforeshow', function(){
return false;
});
if(condition){
UIkit.tooltip($element).show();
}
问题是beforeshow 函数由于某种原因永远不会触发。我什至尝试过UIkit documentation中提到的这种语法:
UIkit.util.on($element, 'beforeshow', function () {
return false;
});
很遗憾,这些方法都不适合我。
【问题讨论】:
标签: getuikit