html5 - Why does post-css not automatically add the browser prefix to css3 attributes when using vue cli scaffolding?
过去多啦不再A梦
过去多啦不再A梦 2017-05-16 13:36:14
0
3
1322

1. Why is the browser prefix not automatically added to css3 attributes when using the scaffolding on the vuejs official website?
For example: transform: tralaste(50%, 0); does not add -webkit, -moz and other browser prefixes

过去多啦不再A梦
过去多啦不再A梦

reply all(3)
仅有的幸福

You are saying that the prefix is ​​not added to you in the dev stage. The autoprefixer is not configured in the dev stage, but it is in the build stage.
In fact, there is no need to enable autoprefixer in the dev stage. Won't the compilation be slower (albeit slightly slower) during development? It is enough to enable the prefix for the current browser

我想大声告诉你

Create new postcss.config.js
Configure autoprefixer

刘奇

Solved, configure in webpack.base.config.js

vue: {
    loaders: utils.cssLoaders({ sourceMap: useCssSourceMap }),
    postcss: [
      require('autoprefixer')({
        // browsers: ['last 2 versions']
         browsers: ['last 10 Chrome versions', 'last 5 Firefox versions', 'Safari >= 6', 'ie > 8']
      })
    ]
  }
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template