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

多文本省略css失效 #8688

Closed
2449847346 opened this issue Feb 18, 2021 · 4 comments
Closed

多文本省略css失效 #8688

2449847346 opened this issue Feb 18, 2021 · 4 comments
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@2449847346
Copy link

相关平台

H5

**浏览器版本: Chrome 79 Mobile Safari 537.36 **
使用框架: React

复现步骤

H5,浏览器测试无问题,手机浏览器首次渲染页面,文本超出规定范围不会有省略号,切换底部tabBar回跳页面,省略功能有效,当渲染遍历新节点时,如懒加载第二页的数据,数据超出依然不会被省略,依然切换底部tabBar有效,刷新页面,多文本效果依然失效

期望结果

多文本超出省略

实际结果

多文本超出未成功省略和效果时机不正确

环境信息

Taro CLI 3.0.16 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 12.16.1 - D:\tools\nodejs\node.EXE
      Yarn: 1.22.10 - D:\tools\nodejs\node_global\yarn.CMD
      npm: 6.13.4 - D:\tools\nodejs\npm.CMD

补充信息

&-title {
height: 60px;
font-size: 26px;
font-weight: 400;
color: #333333;
overflow: hidden;
line-height: 30px;
display: -webkit-box;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}

@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Feb 18, 2021
@luckyadam
Copy link
Member

是被 autoprefixer 处理了,可以选择配置一下 autoprefixer
https://github.com/postcss/autoprefixer#options
配置 remove: false,就不会删掉样式

@2449847346
Copy link
Author

是被 autoprefixer 处理了,可以选择配置一下 autoprefixer
https://github.com/postcss/autoprefixer#options
配置 remove: false,就不会删掉样式

我配置remove:false;没有什么变化,而且说我的配置有误,请问是我配置方式有错误吗?

Taro 配置有误,请检查! (D:\LaiPai\lp_assets_clerk\config\index.js)
[✗] h5.postcss.autoprefixer.remove "h5.postcss.autoprefixer.remove" is not allowed

配置项内容:
h5: {
router: {
mode: "browser",
},
publicPath: "/",
staticDirectory: "static",
esnextModules: ["tmdesign", "taro-ui"],
postcss: {
autoprefixer: {
enable: true,
remove: false,
},
cssModules: {
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
config: {
namingPattern: "module", // 转换模式,取值为 global/module
generateScopedName: "[name][local]_[hash:base64:5]",
},
},
},
},

@Chen-jj
Copy link
Contributor

Chen-jj commented Feb 19, 2021

Duplicate of #6741

3.1 已修复

@Chen-jj Chen-jj closed this as completed Feb 19, 2021
@2449847346
Copy link
Author

Duplicate of #6741

3.1 已修复

感谢答复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

3 participants