如果你对该文章中的内容有疑问/不解,可以点击此处链接提问
要注明问题和此文章链接地址 点击此处跳转
<view class='posting-container' wx:if="{{posting}}"> <view class='post-header'> <text>点击图标+1</text> <text bind:tap="onCancel" class='cancel'>取消</text> </view> <view class='comment-container'> <block wx:for="{{util.limit(comments,3)}}"> <v-tag text = "{{item.content}}" tag-class="{{tool.highlight(index)}}" > <text class='num' slot="after">{{'+'+item.nums}}</text> </v-tag> </block> </view> <input class='post' placeholder='短评最多12个字' ></input> </view> <!-- 在wxml中写wxs --> <wxs module="tool"> var highlight = function(index){ if(index==0){ return 'ex-tag1' } if(index==1){ return 'ex-tag2' } return '' } module.exports={ highlight:highlight } </wxs>