Skip to content

Commit

Permalink
feat: 新增showRight属性控制collapse右侧图标显隐
Browse files Browse the repository at this point in the history
  • Loading branch information
jry committed Jul 29, 2024
1 parent 8991109 commit cc6f2e7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/pages/componentsB/collapse/collapse.nvue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<up-collapse-item title="组件全面" name="Variety components">
<text class="u-collapse-content">众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让您快速集成,开箱即用</text>
</up-collapse-item>
<up-collapse-item title="众多利器" name="Numerous tools">
<up-collapse-item title="众多利器" name="Numerous tools" :showRight="false">
<text class="u-collapse-content">众多的贴心小工具,是您开发过程中召之即来的利器,让您飞镖在手,百步穿杨</text>
</up-collapse-item>
</up-collapse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ export const props = defineMixin({
duration: {
type: Number,
default: () => defProps.collapseItem.duration
}
},
// 显示右侧图标
showRight: {
type: Boolean,
default: () => defProps.collapseItem.showRight
},
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
</slot>
</template>
<template #right-icon>
<u-icon v-if="!$slots['right-icon']" :size="16" name="arrow-right"></u-icon>
<slot name="right-icon">
</slot>
<template v-if="showRight">
<u-icon v-if="!$slots['right-icon']" :size="16" name="arrow-right"></u-icon>
<slot name="right-icon">
</slot>
</template>
</template>
</u-cell>
<view
Expand Down
3 changes: 2 additions & 1 deletion src/uni_modules/uview-plus/libs/config/props/collapseItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {
align: 'left',
name: '',
icon: '',
duration: 300
duration: 300,
showRight: true
}
}

0 comments on commit cc6f2e7

Please sign in to comment.