本文共 734 字,大约阅读时间需要 2 分钟。
vue组件引入scss变量
Using the you can enable “CSS Preprocessors” and you can choose which one to enable:
使用您可以启用“ CSS预处理程序”,还可以选择启用哪个:
If you’re using a project not based upon Vue CLI, or a project that was initialized using Vue CLI but you didn’t add the CSS preprocessor support, you can add it later on using:
如果您使用的不是基于Vue CLI的项目,或者是使用Vue CLI初始化的项目,但未添加CSS预处理程序支持,则可以在以后使用以下方式添加它:
npm install --save-dev node-sass sass-loader
Inside your application components then you can use
在您的应用程序组件内部,您可以使用
and add your SCSS code in there.
并在其中添加您的SCSS代码。
If you want to keep your SCSS code in an external file, you can do that, and just import it in the script part of your component:
如果要将SCSS代码保存在外部文件中,则可以这样做,只需将其导入组件的脚本部分即可:
翻译自:
vue组件引入scss变量
转载地址:http://hoqgb.baihongyu.com/