Skip to content

Commit

Permalink
feat(collapse): 增加自定义插槽 icon (#2588) (#2612)
Browse files Browse the repository at this point in the history
  • Loading branch information
yi-boide authored Oct 25, 2023
1 parent 404e732 commit 2369e09
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/packages/__VUE/collapse/doc.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ Set content through slot: extra
| title | Content slot on the left side of the title bar |
| alue | Right content slot of the title bar |
| extra | Set fixed content under the title (no folding) |
| icon | Set a custom icon |

### Events

Expand Down
1 change: 1 addition & 0 deletions src/packages/__VUE/collapse/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ app.use(CollapseItem);
| title | 标题栏左侧内容插槽 |
| value | 标题栏右侧内容插槽 |
| extra | 设置标题下固定内容(不折叠) |
| icon | 设置自定义图标 |

### Events

Expand Down
1 change: 1 addition & 0 deletions src/packages/__VUE/collapse/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ app.use(CollapseItem);
| title | 标题栏左侧内容插槽 |
| value | 标题栏右侧内容插槽 |
| extra | 设置标题下固定内容(不折叠) |
| icon | 设置自定义图标 |

### Events

Expand Down
3 changes: 2 additions & 1 deletion src/packages/__VUE/collapseitem/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
:class="['nut-collapse-item__title-icon', { 'nut-collapse-item__title-icon--expanded': expanded }]"
:style="{ transform: 'rotate(' + (expanded ? rotate : 0) + 'deg)' }"
>
<component :is="renderIcon(icon)"></component>
<slot v-if="$slots.icon" name="icon"></slot>
<component :is="renderIcon(icon)" v-else></component>
</view>
</view>

Expand Down
3 changes: 2 additions & 1 deletion src/packages/__VUE/collapseitem/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
:class="['nut-collapse-item__title-icon', { 'nut-collapse-item__title-icon--expanded': expanded }]"
:style="{ transform: 'rotate(' + (expanded ? rotate : 0) + 'deg)' }"
>
<component :is="renderIcon(icon)"></component>
<slot v-if="$slots.icon" name="icon"></slot>
<component :is="renderIcon(icon)" v-else></component>
</view>
</view>

Expand Down

0 comments on commit 2369e09

Please sign in to comment.