《Taro》笔记
微信分享
<nut-button open-type="share">微信分享</nut-button>
1
nextTick
import { nextTick } from '@tarojs/taro'
// 表单回显问题,在vue 中onMounted,nextTick勾子函数,表单modelValue还是空,在taro/js提供的nextTick勾子,modelValue是已经更新
// 注意
onMounted(() => {
nextTick(() => {
if (props.modelValue) {
getDetail(props.modelValue)
}
})
})
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
# 省略号
.ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
1
2
3
4
5
2
3
4
5
# 键盘遮挡输入框
问题描述:
1.弹窗中有上下两个输入框,设置了cursorSpacing属性后,从第一个输入框换到第二个输入框的时候,输入框聚焦位置上下偏移。
原因:cursorSpacing设置了与键盘的距离,不同输入框聚焦的时候,距离键盘位置随时改变,但是页面撑起的距离没来得及变化,造成位置误差
解决办法: 同时设置input框的这两个属性
// cursorSpacing: globalStore.systemInfo?.brand === 'iPhone' ? 30 : 0, // 解决键盘不上顶页面
alwaysEmbed: true,
cursorSpacing: '100rpx',
1
2
3
2
3
# 小程序view英文数字不换行的问题
word-break:break-all; 加这样一句话就可以啦
上次更新: 2023/06/28, 17:55:05