Element: [Bug Report] table组件内置tooltip组件,结合transition组件报错

Created on 30 Mar 2017  ·  15Comments  ·  Source: ElemeFE/element

Element UI version

1.2.7

OS/Browsers version

windows 10 / chrome 56 64-bit

Vue version

2.2.6

Reproduction Link

https://jsfiddle.net/coolmrz/dn8x8azz/1/

Steps to reproduce

通过点击table组件中的“去测试2页面”切换路由 控制台就会报错

Uncaught TypeError: Cannot read property 'handleClosePopper' of undefined

调试了下,发现是1.2.7中table-body.js的220行

新添加的这句报错:this.$refs.tooltip.handleClosePopper();

而且现在table内置了tooltip组件,当项目按需引入element-ui时,只引入table组件,没有引入tooltip组件时,会报错,说tooltip组件未注册

这样处理会导致两个组件耦合比较严重吧

What is Expected?

不报错

What is actually happening?

报错

All 15 comments

Same issue

vue.common.js:560 [Vue warn]: Unknown custom element: <el-tooltip> - did you register the component correctly? For recursive components, make sure to provide the "name" option. 
(found in <TableBody>)

table.js:1745 Uncaught TypeError: this.$refs.tooltip.handleClosePopper is not a function
    at VueComponent.handleCellMouseLeave (table.js:1745)
    at boundFn (vue.common.js:126)
    at HTMLTableCellElement.invoker (vue.common.js:1660)

请问楼主问题解决了吗?我也出现这个问题

他们应该解决了,只不过还没发布新版(但为啥把issue关了)

你看看他的commit,应该是缺少声明tooltip组件了

等今天的版本吧

问题并没有解决啊

依然是上边的jsfiddle

版本已经是1.2.8

问题官方知不知道这个BUG存在呢,我知道哪里报错,而且也能简单修复这个报错,就是不知道怎么在项目生效

你把代码发出来瞅瞅

好像不是每次都会出现,所以疏忽了。已经在 #4085 修复。

但是我每次跳转都不会报错,只要页面有table,按同级路由跳转就会报错,,我修复代码很简单,在前面if判断是否对象为空,是为空就不执行下去而已

下个版本能修复这个问题吗

Menu-item在collapse模式下有相同的問題

对,按需引入Menu,在设置collapse为true时ElMenuItem也会报el-tooltip未注册的错误。

I'm seeing the same error when trying to collapse an el-menu component, with components imported _on demand_. I've included the Tooltip component and declared it with the correct name, but still seeing the Unknown custom element: <el-tooltip> console error on collapse event

collapse为true时,点击el-menu,tooltips失效

我也是el-menu tooltip失效

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mochenxm picture mochenxm  ·  3Comments

gengxuelei picture gengxuelei  ·  3Comments

no5no6 picture no5no6  ·  3Comments

fscardua picture fscardua  ·  3Comments

dbskccc picture dbskccc  ·  3Comments