js怎么获取到wxml里面的值?

我现在想通过js获取到这个spid的值,然后通过url传到服务器,起到修改数据的效果。

但是这个spid的值该怎么通过js拿到呢?尝试了很久,不是undefined,就是not found
10 回复
你好。你这样定义后 只需要在你的方法里 这样写传入一个: getValue(e) { spid: e.currentTarget.dataset.id } 页面上请写data-id=“{{item.spid}}”