overflow超出显示_小程序开发之居中、视频播放组件暂停优化、圆角、文本超出省略...

1、多行文本水平居中:利用display: table属性

#container{ width: 600px; height: 300px; border: 1px solid black; display: table;}#text{ display: table-cell; vertical-align:middle; text-align: center;}

2、微信小程序中view中的text标签居中

display:flex;align-items:center;justify-content:center;

3、missing space before opening brace: eslint的规则,意为大括号前丢失空格。

4、组件内无法执行uni-app的暂停视频播放

const curr = e.detail.current; // 暂停播放curr 的上一个及一个视频 if ((curr - 1) >= 0) { const temp = 'myVideo' + (curr - 1); this.myvideo = uni.createVideoContext(temp, this); this.myvideo.pause(); } if ((curr + 1) <= this.videoUrls.length - 1) { const temp = 'myVideo' + (curr + 1); this.myvideo = uni.createVideoContext(temp, this); this.myvideo.pause(); }

5、Trailing spaces not allowed:警告代码后面有多余的空格导致的,删除空格即可。

6、css3 只给左上,右上,左下,右下设置圆角属性

-webkit-border-top-left-radius: 4px;  -webkit-border-top-right-radius: 4px; -webkit-border-bottom-left-radius:4px;-webkit-border-bottom-right-radius:4px;

7、小程序文本超出省略:

display: inline-block; /*设置为弹性盒子*/ overflow:hidden; //超出一行文字自动隐藏 text-overflow:ellipsis;//文字隐藏后添加省略号 white-space:nowrap; //强制不换行overflow: hidden;/*超出隐藏*/ display: -webkit-box; /*设置为弹性盒子*/ -webkit-line-clamp: 3; /*最多显示x行*/ text-overflow: ellipsis; /*超出显示为省略号*/ -webkit-box-orient: vertical;
191bc289388e0ab89304750ea98fa101.png
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值