vue 打包上线后 css3渐变属性丢失的问题解决方案

网上搜索了很多解决方案,最后找到个类似的,可能是optimize-css-assets-webpack-plugin这个插件的问题,其实解决办法很简单,只需要在这个属性前后加一个特殊注释即可,

.score_view {
        /*! autoprefixer: off */
        background: -webkit-gradient(linear, center bottom, center top, from(#146b22), to(#54e475));
        background: -webkit-linear-gradient(bottom,#146b22,#54e475);
        /* autoprefixer: on */
        background: -moz-linear-gradient(bottom,#146b22,#54e475);
        background: -o-linear-gradient(bottom,#146b22,#54e475);
        background: linear-gradient(bottom,#146b22,#54e475);
}

.publish {
        /*! autoprefixer: off */
        background: -webkit-gradient(linear, 100% 0, 0 0, from(rgba(231,70,78,0.9)), to(rgba(255,120,130,0.9)));
        background: -webkit-linear-gradient(left,rgba(231,70,78,0.9), rgba(255,120,130,0.9));
        /* autoprefixer: on */
        background: -moz-linear-gradient(left,rgba(231,70,78,0.9), rgba(255,120,130,0.9));
        background: -o-linear-gradient(left,rgba(231,70,78,0.9), rgba(255,120,130,0.9));
        background: linear-gradient(left,rgba(231,70,78,0.9), rgba(255,120,130,0.9));
      }
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容