scss文件中,设置多行省略(以下),代码未生效css
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;复制代码
代码未生效:webpack
查看style,-webkit-box-orient 编译以后消失git
postcss-loader 默认编译的时候,会过滤 -webkit-box-orient: vertical;github
方案一:对scss文件没有特殊要求,能够换成.less等其余格式文件web
方案二: autoprefixer(推荐使用)浏览器
//单个属性
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
/* autoprefixer: off */
-webkit-box-orient: vertical;
/* autoprefixer: on */复制代码
缘由:bash
1.autoprefixer会帮你删除老式过期的代码
2. autoprefixer也会帮你增长新前缀app
方案二优化:在webpack中配置postcss的autoprefixer:www.webpackjs.com/loaders/pos…less
参考:post