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>

  

posted @ 2025-10-09 14:23  环岛公路  阅读(40)  评论(0)    收藏  举报