【问题标题】:Vue3 autoprefixer config issueVue3 自动前缀配置问题
【发布时间】:2019-06-15 23:15:42
【问题描述】:

我有一个使用 Vue-cli 3 使用 vue create my-new-project 创建的新项目。我正在使用 CSS 网格进行一些布局,我需要支持 IE11 和更高版本。 Vue 文档说 autoprefixer 默认已加载并启用,但它不起作用。我无法让它在 npm run build 或 npm run serve 中工作。在 chrome 中可以正常工作,但 IE11 无法正常工作。我确定有一些配置需要完成,但我不确定那可能是什么。

.browserslistrc:

> 1%
last 4 versions

postcss.config.js:

module.exports = {
  plugins: {
    autoprefixer: {}
  }
};

【问题讨论】:

    标签: vue.js webpack vuejs2 vue-cli-3 autoprefixer


    【解决方案1】:

    默认情况下禁用 CSS 网格支持。
    您可以使用网格:autoplace 选项或/* autoprefixer grid: autoplace */ 控件注释来启用它。

    module.exports = {
      plugins: {
        'autoprefixer': {
          grid: 'autoplace'
        },
      }
    };
    

    Does Autoprefixer polyfill Grid Layout for IE?

    【讨论】:

    • 这很容易!谢谢。
    猜你喜欢
    • 2015-11-26
    • 2016-12-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多