微信小程序开发指南

基于ColorUI的组件化页面开发


索引列表

<h1>索引列表</h1> <ul> <li>样式图例</li> </ul> <p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=75dc07ba27a24c59f5efc7ddb4fc5c8f&amp;file=file.png" alt="" /></p> <ul> <li>示例代码</li> </ul> <pre><code class="language-html">&lt;view class="cu-bar bg-white search fixed" style="top:{{CustomBar}}px;"&gt; &lt;view class="search-form round"&gt; &lt;text class="cuIcon-search"&gt;&lt;/text&gt; &lt;input type="text" placeholder="输入搜索的关键词" confirm-type="search"&gt;&lt;/input&gt; &lt;/view&gt; &lt;view class="action"&gt; &lt;button class="cu-btn bg-gradual-green shadow-blur round"&gt;搜索&lt;/button&gt; &lt;/view&gt; &lt;/view&gt; &lt;scroll-view scroll-y class="indexes" scroll-into-view="indexes-{{listCurID}}" style="height:calc(100vh - {{CustomBar}}px - 50px)" scroll-with-animation="true" enable-back-to-top="true"&gt; &lt;block wx:for="{{list}}" wx:key&gt; &lt;view class="padding indexItem-{{list[index]}}" id="indexes-{{list[index]}}" data-index="{{list[index]}}"&gt;{{list[index]}}&lt;/view&gt; &lt;view class="cu-list menu-avatar no-padding"&gt; &lt;view class="cu-item" wx:for="{{2}}" wx:key wx:for-index="sub"&gt; &lt;view class="cu-avatar round lg"&gt;{{list[index]}}&lt;/view&gt; &lt;view class="content"&gt; &lt;view class="text-grey"&gt;{{list[index]}} &lt;text class="text-abc"&gt;{{list[sub]}}&lt;/text&gt;君&lt;/view&gt; &lt;view class="text-gray text-sm"&gt; 有{{sub+2}}个主子需要伺候 &lt;/view&gt; &lt;/view&gt; &lt;/view&gt; &lt;/view&gt; &lt;/block&gt; &lt;/scroll-view&gt; &lt;view class="indexBar" style="height:calc(100vh - {{CustomBar}}px - 50px)"&gt; &lt;view class="indexBar-box" bindtouchstart="tStart" bindtouchend="tEnd" catchtouchmove="tMove"&gt; &lt;view class="indexBar-item" wx:for="{{list}}" wx:key id="{{index}}" bindtouchstart="getCur" bindtouchend="setCur"&gt;{{list[index]}}&lt;/view&gt; &lt;/view&gt; &lt;/view&gt;</code></pre>

页面列表

ITEM_HTML