Method for using LESS in the Vue-CLI initialization project

What is Less?

LESS is a CSS pre-processing language, which extends the CSS language, increasing the variables, Mixin, function and other characteristics, making CSS more easily and expands .

Now the Vue framework of the front end is increasing, the Vue-CLI is the scaffolding tool for the Vue project, which is the most frequently used in development. In order to better manage our CSS files in the Vue project, we usually introduce LESS or SASS to help us manage our CSS code. Then, this article is intended to record how to use LESS to help us manage CSS code in the Vue-CLI initialized project.

Not much to say, come with Xiaobian to see the detailed introduction

First, install LESS It is recommended to use Taobao mirror installation:

CNPM Install Less Less-loader –save
  , then modify the configuration File: Open the build folder -> Find webpack.base.conf.js, enter configuration code: 

module.exports = {… Module: {Rules: [ … // Insert a configuration code {Test: / @ //, loader: “style”}]}
   [} l}:: ""[[}[[[[[]] []] 
Finally, add lang = “less” in your style tag, scoped represents private scope

/ * * You can write the Less code in this way * /

The above is the full content of this article, I hope this paper has a certain reference value for everyone’s learning or work. If you have any questions, you can leave a message, thank you for tumi cloud support.

© Copyright Notice
Just support it if you like
comment Grab the couch

Please log in to comment