由于element-plus版本更新迭代較快,直接安裝npm install element-plus -D
會(huì)默認(rèn)安裝最新版本,使用時(shí)可能會(huì)報(bào)錯(cuò):
Module not found: Error: Can't resolve 'element-plus/es/components/button/style/css'
可以安裝這個(gè)穩(wěn)定的版本:
npm i element-plus@1.3.0-beta.5 -D
就可以直接在vue文件中調(diào)用了:文章來源:http://www.zghlxwxcb.cn/news/detail-660377.html
<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>
文章來源地址http://www.zghlxwxcb.cn/news/detail-660377.html
到了這里,關(guān)于vue3按需導(dǎo)入element-plus報(bào)錯(cuò)Module not found: Error: Can‘t resolve ‘element-plus/es/components/button/的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!