mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(CollapseItem): can't hide border (#6533)
This commit is contained in:
parent
8a016e64cb
commit
7788822dba
@ -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>
|
||||||
|
@ -31,6 +31,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--borderless {
|
||||||
|
&::after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&--disabled {
|
&--disabled {
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user