Skip to content

Commit

Permalink
fix(grid): [grid] fix grid jsx default slot error (#2285)
Browse files Browse the repository at this point in the history
  • Loading branch information
gimmyhehe authored Oct 17, 2024
1 parent e7647e6 commit b19efbc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/vue/src/grid/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@opentiny/vue-grid",
"type": "module",
"version": "3.18.4",
"version": "3.18.5",
"description": "",
"license": "MIT",
"sideEffects": false,
Expand Down
4 changes: 3 additions & 1 deletion packages/vue/src/grid/src/column/src/column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ export default defineComponent({

const hasSubColumn = findTree(
slotVnode,
({ componentOptions, type }) => {
(node) => {
// 当使用jsx来写默认插槽时,vnode的children为[undefined], 使用fallback值防止解构报错
const { componentOptions, type } = node || {}
const componentName = (type && type.name) || (componentOptions && componentOptions.Ctor.extendOptions.name)

return $table.isValidCustomColumn(componentName)
Expand Down

0 comments on commit b19efbc

Please sign in to comment.