Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

配置vue不生效 也不报错 #21

Open
wangjit opened this issue Apr 28, 2018 · 5 comments
Open

配置vue不生效 也不报错 #21

wangjit opened this issue Apr 28, 2018 · 5 comments

Comments

@wangjit
Copy link

wangjit commented Apr 28, 2018

{
  test: /\.vue$/,
  loader: 'vue-loader',
  options: {
  loaders:{
    css: [
      'vue-style-loader',
      'css-loader',
        {
          loader:'px2rem-loader',
          options: {
            remUnit: 75,
            remPrecision: 8
          }
       }
    ],
    scss: [
      'vue-style-loader',
      'css-loader',
        {
          loader:'px2rem-loader',
          options: {
            remUnit: 75,
            remPrecision: 8
          }
        },
      'sass-loader'
    ],
  }
 }
}

如上代码 不生效 也不报错,看了好多次文档

@WangXiZhu
Copy link

@wangjit 请问目前解决了吗? 遇到同样的问题 需要将vue中css单位转换为 rem

@fantasy525
Copy link

建议大家配置.postcssrc.js来使用这个插件


module.exports = {
  "plugins": {
    "postcss-import": {},
    "postcss-url": {},
    // to edit target browsers: use "browserslist" field in package.json
    "autoprefixer": {},
    "postcss-px2rem": {
      remUnit: 192,
      baseDpr:1.5
    }

  }
}

@WangXiZhu
Copy link

WangXiZhu commented May 29, 2018

参考了 http://www.txtlxg.com/228/dq674362263/article/details/78740820
(域名不能访问了)

@wangjit
Copy link
Author

wangjit commented Jan 3, 2019

@wangjit
Copy link
Author

wangjit commented Jan 3, 2019

@fantasy525 具体怎么做?看得不太明白

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants