Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(collapse): 增加自定义插槽icon(#2588) #2612

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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