fix(CollapseItem): can't hide border (#6533)

This commit is contained in:
neverland 2020-06-12 22:37:38 +08:00 committed by GitHub
parent 8a016e64cb
commit 7788822dba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -125,7 +125,7 @@ export default createComponent({
}, },
genTitle() { genTitle() {
const { disabled, expanded } = this; const { border, disabled, expanded } = this;
const titleSlots = CELL_SLOTS.reduce((slots, name) => { const titleSlots = CELL_SLOTS.reduce((slots, name) => {
if (this.slots(name)) { if (this.slots(name)) {
@ -142,7 +142,7 @@ export default createComponent({
return ( return (
<Cell <Cell
role="button" role="button"
class={bem('title', { disabled, expanded })} class={bem('title', { disabled, expanded, borderless: !border })}
onClick={this.onClick} onClick={this.onClick}
scopedSlots={titleSlots} scopedSlots={titleSlots}
tabindex={disabled ? -1 : 0} tabindex={disabled ? -1 : 0}
@ -172,7 +172,7 @@ export default createComponent({
render() { render() {
return ( return (
<div class={[bem({ border: this.index })]}> <div class={[bem({ border: this.index && this.border })]}>
{this.genTitle()} {this.genTitle()}
{this.genContent()} {this.genContent()}
</div> </div>

View File

@ -31,6 +31,12 @@
} }
} }
&--borderless {
&::after {
display: none;
}
}
&--disabled { &--disabled {
cursor: not-allowed; cursor: not-allowed;