Skip to content

Commit

Permalink
feat(components): [grid] use functional component
Browse files Browse the repository at this point in the history
  • Loading branch information
Hfutsora committed Nov 21, 2022
1 parent 3e92e36 commit e7e96b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/components/grid/src/grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
:style="gridRowStyle"
>
<Component
:is="cell"
:is="() => cell"
v-for="(cell, ci) in row"
:key="`${row.length}-${ci}`"
:key="ci"
:style="cellStyle(ri)"
/>
</div>
Expand All @@ -30,8 +30,8 @@ const props = defineProps(gridProps)
const slots = useSlots()
const defaultSlot = slots.default
const vnodes = computed(() => defaultSlot?.()[0].children ?? []) // TODO: if slot is string
const defaultSlot = computed(() => slots.default?.() ?? null)
const vnodes = computed(() => defaultSlot.value?.[0].children ?? []) // TODO: if slot is string
const total = computed(() => vnodes.value.length as number) // TODO: if slot is string
const real = computed(() => calcRealSize(props.size, total.value))
Expand Down

0 comments on commit e7e96b4

Please sign in to comment.