wxs 编辑器运行可以 真机运行无响应?
发布于 6 年前 作者 xiuyingzhu 6333 次浏览 来自 官方Issues

wxml 文件代码

<wxs src=“list.wxs” module=“list_refresh” />

<!-- 选择器 -->

<template is=“Screen” data="{{…screenData}}" />

<!-- BODY -->

<scroll-view id=‘content’ bindtouchstart=“touchTest” bindtouchmove="{{list_refresh.touchMove}}" bindtouchend="{{list_refresh.touchEnd}}" scroll-y upper-threshold="-50" lower-threshold=‘80’ scroll-with-animation=‘true’ bindscrolltolower=“onReachBottom” class=’{{noneScroll}}’ hidden=’{{hideView}}’>

wxs 文件代码

var touchStartX = 0,touchStartY = 0;

function touchStart(e,ins){

console.log(‘touchStart’)

var touch = e.touches[0] || e.changedTouches[0]

touchStartX = touch.pageX

touchStartY = touch.pageY

console.log([touchStartX,touchStartY]);

}

function touchMove(e,ins){

console.log(‘touchMove’)

var touch = e.touches[0] || e.changedTouches[0]

console.log(touch)

}

function touchEnd(e,ins){

console.log(“touchEnd”)

var touch = e.touches[0] || e.changedTouches[0]

console.log(touch)

}

module.exports = {

touchStart:touchStart,

touchMove:touchMove,

touchEnd:touchEnd

}

js 文件部分代码

touchTest:function(e){

console.log(e);

console.log(‘test’)

},

1 回复

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

回到顶部