vue中使用sass和compass

安装node-sass  sass-loader

进入webpack.base.config.js,rules里添加上以下代码

    {
      test: /.scss$/,
      loaders: ["style", "css", "sass"]
    }

调用的时候在style里面声明

    <style lang="scss" scoped="" type="text/css"></style>

使用compass需要安装 compass-mixins 模块

    然后在style里调用 @import "../../node_modules/compass-mixins/lib/compass";    需要在使用到的模块中调用

    使用@impot "compass",就默认包含了其他的5大模块   layout和reset需要明确指定引入

    layout  提升页面布局的控制能力

    reset 重置

普通重置

    安装normalize.css模块

    @import "../node_modules/normalize.css";         一般normalize模块在app.vue模块调用就可以了

原文地址:https://www.cnblogs.com/xiumumi/p/9947008.html