mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-24 07:29:16 +08:00
fix(CellGroup): incorrect attrs
This commit is contained in:
parent
53109895a9
commit
8f978addd4
@ -1,10 +1,11 @@
|
|||||||
// Utils
|
|
||||||
import { createNamespace } from '../utils';
|
import { createNamespace } from '../utils';
|
||||||
import { BORDER_TOP_BOTTOM } from '../utils/constant';
|
import { BORDER_TOP_BOTTOM } from '../utils/constant';
|
||||||
|
|
||||||
const [createComponent, bem] = createNamespace('cell-group');
|
const [createComponent, bem] = createNamespace('cell-group');
|
||||||
|
|
||||||
export default createComponent({
|
export default createComponent({
|
||||||
|
inheritAttrs: false,
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
title: String,
|
title: String,
|
||||||
border: {
|
border: {
|
||||||
@ -13,19 +14,21 @@ export default createComponent({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
setup(props, { slots }) {
|
setup(props, { slots, attrs }) {
|
||||||
return function () {
|
return () => {
|
||||||
|
const { title, border } = props;
|
||||||
|
|
||||||
const Group = (
|
const Group = (
|
||||||
<div class={[bem(), { [BORDER_TOP_BOTTOM]: props.border }]}>
|
<div class={[bem(), { [BORDER_TOP_BOTTOM]: border }]} {...attrs}>
|
||||||
{slots.default?.()}
|
{slots.default?.()}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
if (props.title || slots.title) {
|
if (title || slots.title) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div class={bem('title')} {...this.$attrs}>
|
<div class={bem('title')}>
|
||||||
{slots.title ? slots.title() : props.title}
|
{slots.title ? slots.title() : title}
|
||||||
</div>
|
</div>
|
||||||
{Group}
|
{Group}
|
||||||
</>
|
</>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user