unplugin-vue-components
unplugin-vue-components copied to clipboard
element-plus中ElNotification组件样式错位
Describe the bug
ElNotification组件样式错位
官网示例

本地样式错位

引入代码如下
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
module.exports = {
// ...
plugins: [
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()],
}),
],
}
Reproduction
none
System Info
node:14.18.2
system:win10
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Used Package Manager
yarn
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [X] The provided reproduction is a minimal reproducible of the bug.
It might not be the plugin issue
if you use auto-import, css weight wiill be higher.
我自定义scss变量的时候,ElMessage和ElMessageBox组件直接没样式,最后只能再增加一个插件unplugin-element-plus解决
ElMessage 和 ElMessageBox 组件直接没样式
我好像是加了 dts: true 之后才出现的,不加也不影响运行