我的目的是为body元素添加一个touchstart事件,但是无法获取到body元素
this.$nextTick(() => {
uni.createSelectorQuery().in(this).select(
'body').addEventListener("touchstart",
function(e) {
console.log('触摸事件')
pub.userClick();
});
})Ï
但是报错:[Vue warn]: Error in event handler for "view.vdSyncCallback": "TypeError: uni.createSelectorQuery(...).in(...).select(...).addEventListener is not a function"
10:12:52.398 (found <Root>)
麦狐人 (作者)
项目文件里没有html文件,只有一个App.vue
2023-05-23 10:28