微信小程序开发指南

基于ColorUI的组件化页面开发


Tab索引

<h1>Tab索引</h1> <ul> <li>样式图例</li> </ul> <p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=1678f369a43dc32d8635640688095488&amp;file=file.png" alt="" /></p> <ul> <li>示例代码</li> </ul> <pre><code class="language-html">&lt;swiper class="screen-swiper round-dot" indicator-dots="true" circular="true" autoplay="true" interval="5000" duration="500"&gt; &lt;swiper-item wx:for="{{4}}" wx:key&gt; &lt;image src="https://image.weilanwl.com/img/4x3-{{index+1}}.jpg" mode='aspectFill'&gt;&lt;/image&gt; &lt;/swiper-item&gt; &lt;/swiper&gt; &lt;view class="VerticalBox"&gt; &lt;scroll-view class="VerticalNav nav" scroll-y scroll-with-animation scroll-top="{{VerticalNavTop}}" style="height:calc(100vh - 375rpx)"&gt; &lt;view class="cu-item {{index==TabCur?'text-green cur':''}}" wx:for="{{list}}" wx:key bindtap='tabSelect' data-id="{{index}}"&gt; Tab-{{item.name}} &lt;/view&gt; &lt;/scroll-view&gt; &lt;scroll-view class="VerticalMain" scroll-y scroll-with-animation style="height:calc(100vh - 375rpx)" scroll-into-view="main-{{MainCur}}" bindscroll="VerticalMain"&gt; &lt;view class="padding-top padding-lr" wx:for="{{list}}" wx:key id="main-{{index}}"&gt; &lt;view class='cu-bar solid-bottom bg-white'&gt; &lt;view class='action'&gt; &lt;text class='cuIcon-title text-green'&gt;&lt;/text&gt; Tab-{{item.name}} &lt;/view&gt; &lt;/view&gt; &lt;view class="cu-list menu-avatar"&gt; &lt;view class="cu-item"&gt; &lt;view class="cu-avatar round lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg);"&gt;&lt;/view&gt; &lt;view class="content"&gt; &lt;view class="text-grey"&gt;凯尔&lt;/view&gt; &lt;view class="text-gray text-sm flex"&gt; &lt;text class="text-cut"&gt; &lt;text class="cuIcon-infofill text-red margin-right-xs"&gt;&lt;/text&gt; 我已天理为凭,踏入这片荒芜,不再受凡人的枷锁遏制。我已天理为凭,踏入这片荒芜,不再受凡人的枷锁遏制。 &lt;/text&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="action"&gt; &lt;view class="text-grey text-xs"&gt;22:20&lt;/view&gt; &lt;view class="cu-tag round bg-grey sm"&gt;5&lt;/view&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="cu-item"&gt; &lt;view class="cu-avatar round lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/img/champion/Taric.png);"&gt; &lt;view class="cu-tag badge"&gt;99+&lt;/view&gt; &lt;/view&gt; &lt;view class="content"&gt; &lt;view class="text-grey"&gt; &lt;text class="text-cut"&gt;瓦洛兰之盾-塔里克&lt;/text&gt; &lt;view class="cu-tag round bg-orange sm"&gt;战士&lt;/view&gt; &lt;/view&gt; &lt;view class="text-gray text-sm flex"&gt; &lt;text class="text-cut"&gt; 塔里克是保护者星灵,用超乎寻常的力量守护着符文之地的生命、仁爱以及万物之美。塔里克由于渎职而被放逐,离开了祖国德玛西亚,前去攀登巨神峰寻找救赎,但他找到的却是来自星界的更高层的召唤。现在的塔里克与古代巨神族的神力相融合,以瓦洛兰之盾的身份,永不疲倦地警惕着阴险狡诈的虚空腐化之力。 &lt;/text&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="action"&gt; &lt;view class="text-grey text-xs"&gt;22:20&lt;/view&gt; &lt;view class="cuIcon-notice_forbid_fill text-gray"&gt;&lt;/view&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="cu-item "&gt; &lt;view class="cu-avatar radius lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/img/champion/Morgana.png);"&gt;&lt;/view&gt; &lt;view class="content"&gt; &lt;view class="text-pink"&gt; &lt;text class="text-cut"&gt;莫甘娜&lt;/text&gt; &lt;/view&gt; &lt;view class="text-gray text-sm flex"&gt; &lt;text class="text-cut"&gt;凯尔,你被自己的光芒变的盲目!&lt;/text&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="action"&gt; &lt;view class="text-grey text-xs"&gt;22:20&lt;/view&gt; &lt;view class="cu-tag round bg-red sm"&gt;5&lt;/view&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="cu-item grayscale"&gt; &lt;view class="cu-avatar radius lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81007.jpg);"&gt;&lt;/view&gt; &lt;view class="content"&gt; &lt;view&gt; &lt;text class="text-cut"&gt;伊泽瑞尔&lt;/text&gt; &lt;view class="cu-tag round bg-orange sm"&gt;断开连接...&lt;/view&gt; &lt;/view&gt; &lt;view class="text-gray text-sm flex"&gt; &lt;text class="text-cut"&gt; 等我回来一个打十个&lt;/text&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="action"&gt; &lt;view class="text-grey text-xs"&gt;22:20&lt;/view&gt; &lt;view class="cu-tag round bg-red sm"&gt;5&lt;/view&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="cu-item cur"&gt; &lt;view class="cu-avatar radius lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81020.jpg);"&gt; &lt;view class="cu-tag badge"&gt;&lt;/view&gt; &lt;/view&gt; &lt;view class="content"&gt; &lt;view&gt; &lt;text class="text-cut"&gt;瓦罗兰大陆-睡衣守护者-新手保护营&lt;/text&gt; &lt;view class="cu-tag round bg-orange sm"&gt;6人&lt;/view&gt; &lt;/view&gt; &lt;view class="text-gray text-sm flex"&gt; &lt;text class="text-cut"&gt; 伊泽瑞尔:&lt;text class="cuIcon-locationfill text-orange margin-right-xs"&gt;&lt;/text&gt; 传送中...&lt;/text&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="action"&gt; &lt;view class="text-grey text-xs"&gt;22:20&lt;/view&gt; &lt;view class="cuIcon-notice_forbid_fill text-gray"&gt;&lt;/view&gt; &lt;/view&gt; &lt;/view&gt; &lt;/view&gt; &lt;/view&gt; &lt;/scroll-view&gt; &lt;/view&gt;</code></pre>

页面列表

ITEM_HTML