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';

改成这样图标就出现了


目录
打赏
0
0
0
0
42
分享
相关文章
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
|
10月前
vue2项目安装出现Syntax Error: Error: Cannot find module ‘less‘
vue2项目安装出现Syntax Error: Error: Cannot find module ‘less‘
232 0
|
10月前
|
WAServiceMainContext.js:2 ReferenceError: result is not defined
WAServiceMainContext.js:2 ReferenceError: result is not defined
85 0
报错permission.js:41 [Vue warn]: Property “showClose“ must be accessed with “$data.showClose“ because
报错permission.js:41 [Vue warn]: Property “showClose“ must be accessed with “$data.showClose“ because
166 0
vue 报错-Module not found: Error: Can't resolve 'element-plus' in '
vue 报错-Module not found: Error: Can't resolve 'element-plus' in '
455 1
vue 报错:Module not found:Error:Can't resolve 'vuex' in XXX
vue 报错:Module not found:Error:Can't resolve 'vuex' in XXX
297 1
|
10月前
./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问题
【Vue warn】If this is a native custom element, make sure to exclude it from component resolution ……
【Vue warn】If this is a native custom element, make sure to exclude it from component resolution ……
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等