wxml:
<view class="index-hd" data-vid="11111111" data-uid="22222222"></view>
<button class="tijiao" type="primary" bindtap="bindtap"></button>
js:
bindtap(e){
console.log(e.target.dataset.vid)
}
wxml:
<view class="index-hd" data-vid="11111111" data-uid="22222222"></view>
<button class="tijiao" type="primary" bindtap="bindtap"></button>
js:
bindtap(e){
console.log(e.target.dataset.vid)
}
you can't get it by clicking on it like this. You need to write data-vid into button to get
view is nested in button
if it is not < view bindtap= "" data-index= "> < button > < / button > < / view >, then use to get the element SelectorQuery.select (string selector)
Previous: How to mock/stub instances of other classes passed in the class to be tested in the unit test?
this path cannot be accessed .. kecheng index this path can be accessed .. kecheng content index current path page faxian index destination path page kecheng index destination subpath page kecheng content index registered in app.json ...