vue3按需导入element-plus报错Module not found: Error: Can‘t resolve ‘element-plus/es/components/button/
Module not found: Error: Can't resolve 'element-plus/es/components/button/style/css'
·
由于element-plus版本更新迭代较快,直接安装npm install element-plus -D
会默认安装最新版本,使用时可能会报错:
Module not found: Error: Can't resolve 'element-plus/es/components/button/style/css'
可以安装这个稳定的版本:
npm i element-plus@1.3.0-beta.5 -D
就可以直接在vue文件中调用了:
<template>
<el-row class="mb-4">
<el-button>Default</el-button>
<el-button type="primary">Primary</el-button>
<el-button type="success">Success</el-button>
<el-button type="info">Info</el-button>
<el-button type="warning">Warning</el-button>
<el-button type="danger">Danger</el-button>
</el-row>
</template>
更多推荐
已为社区贡献7条内容
所有评论(0)