在wxml页面设置后台js中data中的值,可以用到data-*的方法:例子:wxml中代码:js中代码:通过event参数来获取前端data-*中的值在控制台输出:data中的值在event.target.dataset中