Vuejs using less

Source: Internet
Author: User

When everything is ready:

The first step:

Install less dependent,

npm install less less---save

Step Two:

Modify the Webpack.config.js file, configure the loader load dependency, let it support external less, add the original code

{  test:/\.less$/,  loader:"style-loader!css-loader!less-loader",},

Now basically the installation is complete, and then in the use of the style tag to add lang= "less" inside can write less code.

The style tag is added scoped to be valid only in this scope

<style lang="less" scoped></style>或者@import ‘./index.less‘; //引入全局less文件

Introduced directly in HTML:

<link rel="stylesheet/less" type="text/css" href="文件路径/styles.less"><script src="文件路径/less.js" type="text/javascript"></script>

Vuejs using less

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.