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

View File

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