似乎问题在于这些样式规则:
ion-item-group .item-md .item-wrapper:last-child .item-inner,
ion-item-group .item-md:last-child .item-inner {
border: 0;
}
ion-item-group .item-ios:last-child .item-inner,
ion-item-group .item-wrapper:last-child .item-ios .item-inner {
border: 0;
}
并且它们被应用是因为每个custom-component都只包含一个项目,所以每个项目都是其父项的最后一个子项。
解决它的一种方法是手动将 Ionic 默认边框应用于自定义组件中的每个项目(除了 last 中的项目custom-component,就像 Ionic 一样)。
custom-component {
/* ------- */
/* Android */
/* ------- */
/* Add the border to each item */
.item-md.item-block .item-inner,
ion-item-group .item-md .item-wrapper:last-child .item-inner,
ion-item-group .item-md:last-child .item-inner {
border-bottom: 1px solid #dedede;
}
/* Remove the border from the last custom component item */
&:last-child {
.item-md .item-wrapper:last-child .item-inner,
.item-md:last-child .item-inner {
border: 0;
}
}
/* --- */
/* iOS */
/* --- */
/* Add the border to each item */
.item-ios.item-block .item-inner,
ion-item-group .item-ios:last-child .item-inner,
ion-item-group .item-wrapper:last-child .item-ios .item-inner {
border-bottom: .55px solid #c8c7cc;
}
/* Remove the border from the last custom component item */
&:last-child {
.item-ios:last-child .item-inner,
.item-wrapper:last-child .item-ios .item-inner {
border: 0;
}
}
}