微信小程序 WeUI·Cells

2020-07-28 09:57 更新

Cells

Cells是列表分組,常用于嵌套一組Cell或者Checkbox,注意,Checkbox-group和Cell組件都必須放在Cells組件下面,Cells效果如下圖所示。

引入組件

在 page.json 中引入組件

{
  "usingComponents": {
    "mp-cell": "../../components/cell/cell",
    "mp-cells": "../../components/cells/cells"
  }
}

示例代碼

<!--WXML示例代碼-->
<mp-cells ext-class="my-cells" title="帶說明的列表項(xiàng)">
    <mp-cell value="標(biāo)題文字" footer="說明文字"></mp-cell>
    <mp-cell>
        <view>標(biāo)題文字(使用slot)</view>
        <view slot="footer">說明文字</view>
    </mp-cell>
</mp-cells>
// page.js示例代碼
Page({
});

屬性列表

屬性類型默認(rèn)值必填說明
ext-classstring添加在組件內(nèi)部結(jié)構(gòu)的class,可用于修改組件內(nèi)部的樣式
titlestringCells的標(biāo)題
footerstringCells底部的文字

Slot

名稱描述
默認(rèn)內(nèi)容slot


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)