Skip to content

Commit eda6f8e

Browse files
committed
refactor(CTable): table is not reactive
1 parent 6738f28 commit eda6f8e

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

src/components/table/CTable.ts

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -99,26 +99,27 @@ const CTable = defineComponent({
9999
},
100100
},
101101
setup(props, { slots }) {
102-
const table = h(
103-
'table',
104-
{
105-
class: [
106-
'table',
107-
{
108-
[`align-${props.align}`]: props.align,
109-
[`caption-${props.caption}`]: props.caption,
110-
[`border-${props.borderColor}`]: props.borderColor,
111-
'table-bordered': props.bordered,
112-
'table-borderless': props.borderless,
113-
[`table-${props.color}`]: props.color,
114-
'table-hover': props.hover,
115-
'table-sm': props.small,
116-
'table-striped': props.striped,
117-
},
118-
],
119-
},
120-
slots.default && slots.default(),
121-
)
102+
const table = () =>
103+
h(
104+
'table',
105+
{
106+
class: [
107+
'table',
108+
{
109+
[`align-${props.align}`]: props.align,
110+
[`caption-${props.caption}`]: props.caption,
111+
[`border-${props.borderColor}`]: props.borderColor,
112+
'table-bordered': props.bordered,
113+
'table-borderless': props.borderless,
114+
[`table-${props.color}`]: props.color,
115+
'table-hover': props.hover,
116+
'table-sm': props.small,
117+
'table-striped': props.striped,
118+
},
119+
],
120+
},
121+
slots.default && slots.default(),
122+
)
122123
return () => [
123124
props.responsive
124125
? h(
@@ -129,9 +130,9 @@ const CTable = defineComponent({
129130
? 'table-responsive'
130131
: `table-responsive-${props.responsive}`,
131132
},
132-
table,
133+
table(),
133134
)
134-
: table,
135+
: table(),
135136
]
136137
},
137138
})

0 commit comments

Comments
 (0)