element-ui.common.js:23528 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'indexOf')
时间: 2023-10-17 19:35:09 浏览: 158
Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object’#Object‘的解决方法
您遇到的错误是由于引入element-ui的方式错误导致的。在Vue3.0中,element-ui已经升级为element-plus。解决这个问题的步骤如下:
第一步,您需要通过npm安装element-plus依赖:
```
npm install element-plus --save
```
第二步,您需要在main.js中进行配置。首先,您需要引入element-plus和对应的CSS样式:
```javascript
import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';
```
然后,您需要使用ElementPlus插件:
```javascript
createApp(App).use(ElementPlus).mount('#app');
```
这样,您就可以正确地引入element-plus并解决这个错误了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Vue引入element-ui报错:Uncaught TypeError: Cannot read property ‘prototype‘ of undefined](https://blog.csdn.net/qq_38668544/article/details/117083525)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文