Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-webkit-box-orient: vertical; 构建后丢失问题 #5

Open
imfenghuang opened this issue Mar 8, 2018 · 1 comment
Open

-webkit-box-orient: vertical; 构建后丢失问题 #5

imfenghuang opened this issue Mar 8, 2018 · 1 comment

Comments

@imfenghuang
Copy link
Owner

常用多行溢出隐藏样式

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

-webkit-box-orient: vertical; 构建后丢失

今天项目中使用 vue-cli 进行 build 命令操作后,发现 多行移除隐藏 失效了,可是在 dev 时好好的呀。审查元素发现,构建之后的样式丢失了 -webkit-box-orient: vertical; 这句。

google 发现网上有好些人也遇到了同样的问题,尝试了网上给出的解决方法,如下

/* autoprefixer: off */
-webkit-box-orient: vertical;
/* autoprefixer: on */

再次构建,发现问题未解决。
记一笔没问题待解决,改天再来看这个问题。

@imfenghuang
Copy link
Owner Author

解决办法:注释掉 webpack.prod.conf.js 中以下这段代码:

new OptimizeCSSPlugin({
    cssProcessorOptions: config.build.productionSourceMap ? { safe: true, map: { inline: false } } : { safe: true }
}),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant