1、textarea 默认最大长度为140
2、获取小程序输入框的值
绑定方法:bindinput 获值方法:event.detail.value
3、获取url上的参数
options.key
4、获取data-[]的值
event.currentTarget.dataset.key
5、小程序audio组件在iOS不能播放
<audio
poster="{{postData.music.coverImg}}"
name="{{postData.music.title}}"
author="{{postData.author}}"
src="{{postData.music.url}}"
id="myAudio"
bindtap='audioClick' controls loop >
</audio>
Page({
data: {
isPlaying: false
},
onReady:function(e){
this.audioCtx = wx.createAudioContext('myAudio')
},
onUnload:function(){
this.data.innerAudioContext.destroy();
},
audioClick(e) {
this.setData({
isPlaying:!this.data.isPlaying
})
if (this.data.isPlaying) {
this.audioCtx.play();
console.log("播放")
} else {
this.audioCtx.pause();
}
}
})