unplugin-vue-components
unplugin-vue-components copied to clipboard
use AntDesignVueResolver({ importStyle: 'less' }),message component cannot load css
AntDesignVueResolver({ importStyle: 'less' })
import { message } from 'ant-design-vue'
message.success(‘上传图片成功’)
Appears at the bottom of the page and the style is missing.
https://github.com/antfu/unplugin-vue-components/issues/162 不在模板里写,这个插件检测不到
如果你使用的 Vite,你可以使用 unplugin-vue-components 来进行按需加载。但是此插件无法处理非组件模块,如 message,这种组件需要手动加载
import { message } from 'ant-design-vue';
import 'ant-design-vue/es/message/style/css'; //vite只能用 ant-design-vue/es 而非 ant-design-vue/lib
This issue is considered resolved then yes?