From 8f978addd49b7d2a5e6fcce0c952fcb05145ad1d Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Mon, 24 Aug 2020 19:47:52 +0800 Subject: [PATCH] fix(CellGroup): incorrect attrs --- src/cell-group/index.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/cell-group/index.js b/src/cell-group/index.js index bdf702908..72800f262 100644 --- a/src/cell-group/index.js +++ b/src/cell-group/index.js @@ -1,10 +1,11 @@ -// Utils import { createNamespace } from '../utils'; import { BORDER_TOP_BOTTOM } from '../utils/constant'; const [createComponent, bem] = createNamespace('cell-group'); export default createComponent({ + inheritAttrs: false, + props: { title: String, border: { @@ -13,19 +14,21 @@ export default createComponent({ }, }, - setup(props, { slots }) { - return function () { + setup(props, { slots, attrs }) { + return () => { + const { title, border } = props; + const Group = ( -
+
{slots.default?.()}
); - if (props.title || slots.title) { + if (title || slots.title) { return ( <> -
- {slots.title ? slots.title() : props.title} +
+ {slots.title ? slots.title() : title}
{Group}