Skip to content

Commit 08796b6

Browse files
authored
fix(collapse): ensure border property correctly disables bottom border (#5905)
1 parent 6187937 commit 08796b6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/collapse-item/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ VantComponent({
2828

2929
data: {
3030
expanded: false,
31+
parentBorder: true,
3132
},
3233

3334
mounted() {
@@ -41,7 +42,7 @@ VantComponent({
4142
return;
4243
}
4344

44-
const { value, accordion } = this.parent.data;
45+
const { value, accordion, border } = this.parent.data;
4546
const { children = [] } = this.parent;
4647
const { name } = this.data;
4748

@@ -56,7 +57,7 @@ VantComponent({
5657
setContentAnimate(this, expanded, this.mounted);
5758
}
5859

59-
this.setData({ index, expanded });
60+
this.setData({ index, expanded, parentBorder: border });
6061
},
6162

6263
onClick() {

packages/collapse-item/index.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<wxs src="../wxs/utils.wxs" module="utils" />
22

3-
<view class="van-collapse-item custom-class {{ index !== 0 ? 'van-hairline--top' : '' }}">
3+
<view class="van-collapse-item custom-class {{ index !== 0 && parentBorder ? 'van-hairline--top' : '' }}">
44
<van-cell
55
size="{{ size }}"
66
title="{{ title }}"

0 commit comments

Comments
 (0)