Element-Module not found: Error: Can‘t resolve ‘@element-plus/icons-vue/dist/types‘ in ‘D:\project\

简介: Element-Module not found: Error: Can‘t resolve ‘@element-plus/icons-vue/dist/types‘ in ‘D:\project\

今天在敲代码的遇到了

Module not found: Error: Can't resolve '@element-plus/icons-vue/dist/types' in 'D:\project

这里如何解决,这里我是在引入Element-ui的局部组件样式时候出现的问题

<template>
    <div>
        <el-icon :size="size" :color="color">
            <Edit></Edit>
        </el-icon>
    </div>
</template>
 
<script>
import { Edit } from '@element-plus/icons-vue/dist/types';
export default {
    name: "MyIcons",
    components: {
        Edit
    }
}
</script>
 
<style></style>

后来找到了解决方案是:

import 引入应该这样写:

import { Edit } from '@element-plus/icons-vue';

改成这样图标就出现了


相关文章
|
6月前
报错/ ./node_modules/axios/lib/platform/index.js Module parse failed: Unexpected token (5:2)怎么解决?
报错/ ./node_modules/axios/lib/platform/index.js Module parse failed: Unexpected token (5:2)怎么解决?
|
4月前
|
JavaScript
This dependency was not found:* vue/types/umd in ./src/router/index.jsTo install it, you can run
This dependency was not found:* vue/types/umd in ./src/router/index.jsTo install it, you can run
This dependency was not found:* vue/types/umd in ./src/router/index.jsTo install it, you can run
|
6月前
vue2项目安装出现Syntax Error: Error: Cannot find module ‘less‘
vue2项目安装出现Syntax Error: Error: Cannot find module ‘less‘
84 0
|
12月前
|
JavaScript
vue 报错-Module not found: Error: Can't resolve 'element-plus' in '
vue 报错-Module not found: Error: Can't resolve 'element-plus' in '
283 1
|
6月前
./node_modules/vue-qr/dist/vue-qr.js报错You may need an appropriate loader to handle this file type问题
./node_modules/vue-qr/dist/vue-qr.js报错You may need an appropriate loader to handle this file type问题
|
6月前
|
JavaScript
【Vue Error】Virtual script not found, may missing <script lang=“ts“> “allowJs“: true / jsconfig.json
【Vue Error】Virtual script not found, may missing <script lang=“ts“> “allowJs“: true / jsconfig.json
|
11月前
|
前端开发 JavaScript
Module build failed: TypeError: this.getResolve is not a function,vue写css时启动出错
Module build failed: TypeError: this.getResolve is not a function,vue写css时启动出错
45 0
|
11月前
|
JavaScript
Vue项目报错:This relative module was not found
Vue项目报错:This relative module was not found
|
12月前
|
Web App开发 JavaScript
vue踩坑-Error: Can't resolve 'sass-loader' in 'E:\Element-UI-master\src\components'
vue踩坑-Error: Can't resolve 'sass-loader' in 'E:\Element-UI-master\src\components'
128 0
|
JavaScript
关于js报错Cannot set properties of undefined (setting ‘innerHTML‘)的问题
关于js报错Cannot set properties of undefined (setting ‘innerHTML‘)的问题
375 0