vue configuration in scss

 

 

 

1 Installation

npm install --save-dev sass-loader//sass-loader依赖于node-sass

npm install --save-dev node-sass

Configuration 2: Add a profile in the build folder under the rules inside webpack.base.conf.js

{

  test: /\.sass$/,

  loaders: ['style', 'css', 'sass']

} // do not know why I would not have configured the package, the configuration is not easy to use

3 modify the style tags APP.vue

<style lang="scss">

4 Use

(1) variable

1-1) Using Variables

sass make an important characteristic is its people to benefit as css introduces variables. You can re-use the css property values defined as variables, and then refer to them by the variable name, without repeating the writing of this property value. Alternatively, for use only after a property value times, you can give it a variable name easy to understand, people know at a glance the use of the property value.

Guess you like

Origin www.cnblogs.com/yangjingyang/p/11586992.html