-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handleTinyGridColumnsSlots方法中node.props.columns不是数组时造成页面无法加载问题 #1163
base: develop
Are you sure you want to change the base?
The head ref may contain hidden characters: "handleTinyGridColumnsSlots\u65B9\u6CD5\u4E2Dcolumns\u4E0D\u662F\u6570\u7EC4\u65F6\u9020\u6210\u65E0\u6CD5\u52A0\u8F7D\u9875\u9762\u95EE\u9898"
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,8 @@ const rootSchema = ref([ | |
]) | ||
|
||
const handleTinyGridColumnsSlots = (node) => { | ||
for (const columnItem of node.props?.columns || []) { | ||
let columns = node.props?.columns && Array.isArray(node.props?.columns) ? node.props.columns : [] | ||
for (const columnItem of columns) { | ||
Comment on lines
+77
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good defensive programming to fix loading issue. The addition of the This solution properly handles edge cases while maintaining the original functionality. |
||
if (!columnItem?.slots) { | ||
continue | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样是不是就好了?
let columns = Array.isArray(node.props?.columns) ? node.props.columns : []