WXML如下定义:
<view class='m-item-name' data-return-cid="{{items.cid}}" data-return-cname="{{items.cname}}" data-return-pid="{{item.pid}}" data-return-pname="{{item.pname}}" catchtap="fnClickItem">{{items.cname}}</view>
JS代码中,通过console打印可以查看到e.currentTarget.dataset中有值,但通过变量去获取这些值时提示“returnCid is not defined”
console.log('doubleMenuLayer.fnClickItem', JSON.stringify(e));
let cid = e.target.dataset.returnCid;
试试 e.currentTarget.dataset.returnCid