Skip to content

常用代码片段

获取元素节点信息

jsx

onReady(() => {
		const query = uni.createSelectorQuery();
		query.select('元素').boundingClientRect(data => {
			console.log(data)
		}).exec();
	})

Video手动操作暂停播放

html:<video  id="myVideo" :src="url"></video>js:
this.videoContext = uni.createVideoContext('myVideo');//创建视频实例指向video使用:this.videoContext.play();  播放
this.videoContext.pause(); 暂停