怎样把值传给wxs?dataset传递失败

发布于 7 年前作者 pfan2113 次浏览最后编辑 7 年前来自 issues

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

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

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

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



2 回复
maolei
maolei1 楼6 年前

currentTarget?

guiying13
guiying132 楼5 年前

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