search

Home  >  Q&A  >  body text

html5 - Why does post-css not automatically add the browser prefix to css3 attributes when using vue cli scaffolding?

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梦2774 days ago1324

reply all(3)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-16 13:38:14

    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

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-16 13:38:14

    Create new postcss.config.js
    Configure autoprefixer

    reply
    0
  • 怪我咯

    怪我咯2017-05-16 13:38:14

    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']
          })
        ]
      }

    reply
    0
  • Cancelreply