Replies: 1 comment
-
根据问题描述,问题出在Vite配置的SCSS全局变量未正确注入到通过@use引入的文件中。以下是逐步解决方案:
在vite.config.js中,确认@别名指向src目录:
然后在组件中直接使用变量,无需@use引入。
最终配置推荐
组件使用示例:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
如题,跑起来之后会报错,如果该页面不使用@use而是直接把样式写到style里面就没有这个问题。使用@import会在控制台打印一大堆的警告信息,没有办法解决了,求助啊!!!
这是附件vite-demo.zip
Beta Was this translation helpful? Give feedback.
All reactions