微信小程序开发指南

基于ColorUI的组件化页面开发


图片上传

<h1>图片上传</h1> <ul> <li>样式图例</li> </ul> <p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=270758ac3594b98ecdc37ba83135fbd4&amp;file=file.png" alt="" /></p> <ul> <li>示例代码</li> </ul> <pre><code class="language-html"> &lt;view class="cu-bar bg-white margin-top"&gt; &lt;view class="action"&gt; 图片上传 &lt;/view&gt; &lt;view class="action"&gt; {{imgList.length}}/4 &lt;/view&gt; &lt;/view&gt; &lt;view class="cu-form-group"&gt; &lt;view class="grid col-4 grid-square flex-sub"&gt; &lt;view class="bg-img" wx:for="{{imgList}}" wx:key="{{index}}" bindtap="ViewImage" data-url="{{imgList[index]}}"&gt; &lt;image src='{{imgList[index]}}' mode='aspectFill'&gt;&lt;/image&gt; &lt;view class="cu-tag bg-red" catchtap="DelImg" data-index="{{index}}"&gt; &lt;text class="cuIcon-close"&gt;&lt;/text&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="solids" bindtap="ChooseImage" wx:if="{{imgList.length&lt;4}}"&gt; &lt;text class="cuIcon-cameraadd"&gt;&lt;/text&gt; &lt;/view&gt; &lt;/view&gt; &lt;/view&gt;</code></pre>

页面列表

ITEM_HTML