ant-design-vue 4.x版本在谷歌浏览器80版本中样式不显示的问题
之前是用了组件的自动导入的插件 unplugin-vue-components 在谷歌140版本中显示正常,但是在80版本中样式没有加载
解决方法: 卸载 unplugin-vue-components 同时也删除components.d.ts文件
改用在main.ts全局引入
//main.ts import Antd from 'ant-design-vue' const app = createApp(App) app.use(Antd)
在app.vue中添加如下:
//App.vue
import { StyleProvider, legacyLogicalPropertiesTransformer } from 'ant-design-vue'
<StyleProvider hash-priority="high" :transformers="[legacyLogicalPropertiesTransformer]">
<router-view />
</StyleProvider>

浙公网安备 33010602011771号