fix(element-nav): 动态添加元素渲染异常 (#2276)

pull/2284/head
morning-star 2024-10-14 23:42:10 +08:00 committed by GitHub
parent c781567a68
commit a1491c1936
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 34 additions and 34 deletions

View File

@ -499,14 +499,15 @@ layui.define('jquery', function(exports){
var itemElem = othis.find('.'+NAV_ITEM);
// hover 滑动效果
if (!othis.find('.'+NAV_BAR)[0]) {
var hasBarElem = othis.find('.'+NAV_BAR)[0];
if (hasBarElem) hasBarElem.remove();
othis.append(bar);
( othis.hasClass(NAV_TREE)
? itemElem.find('dd,>.'+ NAV_TITLE)
: itemElem
).on('mouseenter', function() {
).off('mouseenter.lay_nav').on('mouseenter.lay_nav', function() {
follow.call(this, bar, othis, index);
}).on('mouseleave', function() { // 鼠标移出
}).off('mouseleave.lay_nav').on('mouseleave.lay_nav', function() { // 鼠标移出
// 是否为垂直导航
if (othis.hasClass(NAV_TREE)) {
bar.css({
@ -524,7 +525,7 @@ layui.define('jquery', function(exports){
});
// 鼠标离开当前菜单时
othis.on('mouseleave', function() {
othis.off('mouseleave.lay_nav').on('mouseleave.lay_nav', function() {
clearTimeout(timer[index])
timeEnd[index] = setTimeout(function() {
if (!othis.hasClass(NAV_TREE)) {
@ -536,7 +537,6 @@ layui.define('jquery', function(exports){
}
}, TIME);
});
}
// 展开子菜单
itemElem.find('a').each(function() {