javascript - 如何在 vite2 和 vue 的 js 中使用 $red、$bgColor 等 scss 变量?
问题描述
当我使用 webpack 从 scss 导入变量时:
/* variable.scss*/
$red:'#123456'
:export{
navibarText:$red
}
我可以导入它并在javascript中使用:
import variables from '@/styles/variables.scss'
console.log(variables.$navibarText)
我无法在 vite 的 javascript 中正确导入 scss 并使用它,如何在 vite2 和 vue 的 js 中使用 $red、$bgColor 等 scss 变量?
解决方案
推荐阅读
- ruby-on-rails - Heroku:rake 预编译的参数数量错误
- python-3.x - 如何使用python为Chrome浏览器创建书签
- unity3d - Bolt / Visual Scripting运行if语句两次?
- python - 每 x 秒循环一次,当条件不再满足时中断循环
- google-cloud-platform - OAuth 同意 - 已验证的应用程序向用户显示该应用程序不安全。我能做些什么?
- python - 在 Python vs 中使用 h5 文件时出现 UnicodeEncodeError
- typescript - 在 Typescript 中键入递归的不可变 js 记录
- wordpress - 如何在 wordpress 中自定义帖子元?
- reactjs - “错误:您必须将组件传递给连接返回的函数。而不是收到未定义的。”
- python - PYTHON - 启用元素的 StaleElementReferenceException