最近在项目中,遇到一个属性的打包的问题,在本地看没有问题,在线上是有问题的。在网上看到有3个解决方案,参考链接是https://blog.csdn.net/weixin_41544124/article/details/92646582
以上说的3个解决方案中,只有第二种的解决方法才有效果,那就是在行内样式-写
<span class="item_topic" style="-webkit-box-orient: vertical;">{{item.goodsName}}</span>
其他的还有方法是
github上有人提的
参考链接:https://github.com/cssnano/cssnano/issues/357
/* autoprefixer: ignore next */
-webkit-box-orient: vertical;
/* autoprefixer: off */
-webkit-box-orient: vertical;
/* autoprefixer: on */
另外还有就是optimize-css-assets-webpack-plugin这个插件的问题
注释掉webpack.prod.conf.js中下面的代码
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { safe: true }
}),
以上几种方法自己试了下不行,有兴趣的小伙伴可以自己试下。