Use the Compass method in Vue, and use the compass method in vue.

Source: Internet
Author: User
Tags install node npm install node

Use the Compass method in Vue, and use the compass method in vue.

Motivation

After a long delay, I finally made up my mind to write my own personal websites. Not only do I have to look so cool, but I also need to be OK with technology, so take this opportunity to exercise your unfamiliar technologies. The website plans to use Vue as the front-end framework, and Css uses Sass for writing. However, it suddenly occurred before the official start that, since Sass has such a powerful tool as Compass, it's not a step-by-step approach, however, after looking for a round of discovery, we all talked about how to use Sass in the Vue project without the Compass solution. However, I was unwilling to give up a powerful tool to practice, so after continuing searching and trying, I finally succeeded in using Compass in the project, and then I came to share it, if we can help us with this kind of demand, it would be excellent. Let's not talk about it much. Start coding and I will put this Demo on GitHub ( ̄ ▽  ̄ )~ *

Use vue-cli to create a project

Vue init webpack compass-demo // upload a barbecue grill npm install normalize.css axios vuex -- save // sprinkle with some seasoning npm install node-sass-loader mockjs -- save-dev // Brush some sauce npm install compass-mixins -- save-dev // prepare the seasoning on the barbecue shelf and put the tender meat

Modify configurations

Modify build/util. js

...Exports.css Loaders = function (options ){... return {... // modify sass and scss to sass: generateLoaders ('sass ', {indentedSyntax: true, includePaths: [path. resolve (_ dirname ,'.. /node_modules/compass-mixins/lib ')]}, scss: generateLoaders ('sass', {includePaths: [path. resolve (_ dirname ,'.. /node_modules/compass-mixins/lib ')]}),...}...

That's simple.

* In the sass File

* In the vue File

Happy Birthday ~

Add the Demo GitHub address vue-compass.

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

Related Article

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.