Your location:Tech News>News>Script>Sass sample code used in the project global style set (less / sass and css) Detailed configuration vue-cli sass explains how to use and configure sassvue2 used sass sass global style variables vue Method

Latest News

Sass sample code used in the project global style set (less / sass and css) Detailed configuration vue-cli sass explains how to use and configure sassvue2 used sass sass global style variables vue Method

Author:fsadmin

Views:

  1, will save on package.json automatically added.

  npm install node-sass --save-dev

  npm install sass-loader --save-dev

  Note:

  Npm install will typically use the following error, the installation fails.(Network problems)

  

  By Taobao npm image installation node-sass, to solve the above problem.

  $ Npm install -g cnpm --registry = https: // registry.npm.taobao.org (installation Taobao Mirror)

  $ Cnpm install node-sass --save (Taobao mirror mounted using node-sass)

  2.Enter webpack.,.,.js configuration scss module - loaders (That''s all for this article, I want to be helpful to learn, I hope you will support script Home.,

  $ Npm install --save-dev sass-loader style-loader ,

  ,

  test: / ",.,

  ,

  ,

  ,

  ,!css-loader!,

  ,

  ,

  ,

  ,.base.config.,.You may also be interested in the article: Vue2)

  ,

  test: / ",

  vue $ /,.loader: vue-loader'',

  (Png | jpe

  options: vueLoaderConfig

  ,

  loaders: [ "style", "css", "sass"vue1

  ,.,

  ,

  ,

  ,,

  [Ext] '')

  g | gif | svg) (",.,?,?.,?,

  ,

  ,

  ,

  ,.,.,.,

  3

  scss $ /,

  {

  ,.{

  test: / ",

  If you need scss file in vue style tag, then declare it:,

  {

  $ /,.loader: ''url-loader'',?[Hash: 7]?.*)?0

  assetsPath ( ''fonts / [name]

  query: {

  limit: 10000,

  name: utils.}.].}

  }

  }

  ]

  }

  3.0

  vue1.0

  

  vue2.0

  

  Sass sample code used in the project vue2.

  1, will save on package.json automatically added

Recommend article

Relate article