报错提示:
element-ui.common.js:2436 Uncaught TypeError: Cannot read properties of null (reading 'setAttribute')
at VueComponent.removeTabindex (element-ui.common.js:2436:1)
at VueComponent.hide (element-ui.common.js:2334:1)
at Object.eval [as documentHandler] (clickoutside.js:39:1)
at eval (clickoutside.js:25:1)
at Array.forEach (<anonymous>)
at HTMLDocument.eval (clickoutside.js:24:1)
原因就是使用了<el-dropdown> 但是却没有它的子组件 <el-dropdown-menu>,
<el-dropdown>
<el-button type="primary">
<i class="el-icon-switch-button"></i><span>更多菜单</span>
</el-button>
</el-dropdown>
解决办法:
1. 加一个<el-dropdown-menu>文章来源:https://www.toymoban.com/news/detail-766688.html
2. 不要用这个组件就行文章来源地址https://www.toymoban.com/news/detail-766688.html
到了这里,关于VUE+element UI :TypeError: Cannot read properties of null (reading ‘setAttribute‘)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!