vue webpack打包 -webkit-box-orient 失效

一行省略

overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;

超出两行省略

overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
 -webkit-line-clamp: 2;
-webkit-box-orient: vertical;

在使用webpack打包时,由于webpack会添加上前缀兼容,可能某些css属性失效。

解决方法:添加注释

注意:在css sass stylue中注释略有不同 

//在scss中
         /*! autoprefixer: off */
         -webkit-box-orient: vertical;
          /* autoprefixer: on */
/* autoprefixer: off */
  -webkit-box-orient: vertical;
 /* autoprefixer: on */
原文地址:https://www.cnblogs.com/zjx304/p/9867758.html