怎样把值传给wxs?dataset传递失败
发布于 5 年前 作者 pfan 1908 次浏览 来自 官方Issues

<wxs module="slideMovesrc="./slideMove.wxs"></wxs>

<view class="liveRoomContainerbindtap="bigTapdata-width="{{windowWidth}}bindtouchmove="{{slideMove.touchmove}}bindtouchend="{{slideMove.touchend}}bindtouchstart="{{slideMove.touchstart}}">里面嵌套了一些cover-view标签</view>

// 屏幕宽度    windowWidth: wx.getSystemInfoSync().windowWidth   

wxs中,e.target.dataset是{}, width值取不到, 怎么传过去啊?



2 回复

currentTarget?

你在父组件页面获取,然后在传值给wxs处理不更好吗。。。

回到顶部