Browse Source

feat(CellGroup): 支持title使用插槽设置 (#816)

* feat(CellGroup): 支持title使用插槽设置

* docs(cell): 增加CellGroup的插槽文档说明
297cwrun 4 years ago
parent
commit
aadf053764
2 changed files with 6 additions and 1 deletions
  1. 4 0
      src/packages/__VUE/cell/doc.md
  2. 2 1
      src/packages/__VUE/cellgroup/index.vue

+ 4 - 0
src/packages/__VUE/cell/doc.md

@@ -124,3 +124,7 @@ export default {
 | default       | 自定义内容           |
 | link          | 自定义右侧 link 区域 |
 
+## CellGroup Slots
+| 名称          | 说明                 |
+|---------------|----------------------|
+| title `v3.1.10` | 自定义title区域 |

+ 2 - 1
src/packages/__VUE/cellgroup/index.vue

@@ -1,6 +1,7 @@
 <template>
   <view :class="classes">
-    <view v-if="title" class="nut-cell-group__title">{{ title }}</view>
+    <slot v-if="$slots.title" name="title"></slot>
+    <view v-else-if="title" class="nut-cell-group__title">{{ title }}</view>
     <view class="nut-cell-group__warp">
       <slot></slot>
     </view>