You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
497 B
Plaintext
20 lines
497 B
Plaintext
<wxs module="utils">
|
|
module.exports = {
|
|
isActive: function(arr, value) {
|
|
if (!arr) return false;
|
|
|
|
for (var i = 0; i < arr.length; i++) {
|
|
if (arr[i] === value) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
</wxs>
|
|
<view class="tab-bar">
|
|
<view wx:for="{{list}}" wx:key="pagePath" class="tab-item {{utils.isActive(item.pages,nowPage) ? 'active' : ''}}"
|
|
data-index="{{index}}" bindtap="onChange">
|
|
<text class="text">{{item.text}}</text>
|
|
</view>
|
|
</view> |