VW适配方案后造成伪类使用content报错的解决办法 already has a 'content' property, give up to overwrite it.

在运行vue程序时,提示content报错的解决办法 already has a 'content' property, give up to overwrite it。搜索了好长时间,终于找到了解决办法,亲测有效,可以试下

配置postcssrc.js的postcss-viewport-units

 'postcss-viewport-units': {
  filterRule: rule => rule.selector.includes('::after') && rule.selector.includes('::before') && rule.selector.includes(':after') && rule.selector.includes(':before')
}

or

 'postcss-viewport-units': {
    filterRule: rule => rule.nodes.findIndex(i => i.prop === "content") === -1
}

你可能感兴趣的:(VW适配方案后造成伪类使用content报错的解决办法 already has a 'content' property, give up to overwrite it.)