-
Notifications
You must be signed in to change notification settings - Fork 741
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
修复拖拽调整页面顺序 #640
base: master
Are you sure you want to change the base?
修复拖拽调整页面顺序 #640
Conversation
@@ -279,6 +279,9 @@ export const getDepNodeIds = (dataSourceDeps: DataSourceDeps = {}) => | |||
* @param parentId 父节点 id | |||
*/ | |||
export const replaceChildNode = (newNode: MNode, data?: MNode[], parentId?: Id) => { | |||
if(newNode.id==="1"){ |
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.
这个“1”是有什么特殊意义?
newNode.id==="1"代表根节点,无需进行后面的操作,不然执行到下面也会报错“未找到父节点”
________________________________
From: ***@***.*** ***@***.***> on behalf of roymondchen ***@***.***>
Sent: Thursday, January 16, 2025 2:41 PM
To: Tencent/tmagic-editor ***@***.***>
Cc: undefined ***@***.***>; Author ***@***.***>
Subject: Re: [Tencent/tmagic-editor] 修复拖拽调整页面顺序 (PR #640)
@jia000 requested changes on this pull request.
________________________________
In packages/utils/src/index.ts<#640 (comment)>:
@@ -279,6 +279,9 @@ export const getDepNodeIds = (dataSourceDeps: DataSourceDeps = {}) =>
* @param parentId 父节点 id
*/
export const replaceChildNode = (newNode: MNode, data?: MNode[], parentId?: Id) => {
+ if(newNode.id==="1"){
这个“1”是有什么特殊意义?
―
Reply to this email directly, view it on GitHub<#640 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADNFIAWSPUQTQEC47D2WQNT2K5ICDAVCNFSM6AAAAABVERYIRCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKNJUHEYTKMJQGI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
根节点的判断应该是 newNode.type === NodeType.ROOT |
对,这样写更容易理解
…---原始邮件---
发件人: ***@***.***>
发送时间: 2025年1月16日(周四) 晚上7:17
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [Tencent/tmagic-editor] 修复拖拽调整页面顺序 (PR #640)
newNode.id==="1"代表根节点,无需进行后面的操作,不然执行到下面也会报错“未找到父节点”
________________________________ From: @.*** @.> on behalf of roymondchen @.> Sent: Thursday, January 16, 2025 2:41 PM To: Tencent/tmagic-editor @.> Cc: undefined @.>; Author @.***> Subject: Re: [Tencent/tmagic-editor] 修复拖拽调整页面顺序 (PR #640) @jia000 requested changes on this pull request.
________________________________ In packages/utils/src/index.ts<#640 (comment)>:
@@ -279,6 +279,9 @@ export const getDepNodeIds = (dataSourceDeps: DataSourceDeps = {}) =>
@param parentId 父节点 id / export const replaceChildNode = (newNode: MNode, data?: MNode[], parentId?: Id) => { + if(newNode.id==="1"){ 这个“1”是有什么特殊意义? ― Reply to this email directly, view it on GitHub<#640 (review)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADNFIAWSPUQTQEC47D2WQNT2K5ICDAVCNFSM6AAAAABVERYIRCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKNJUHEYTKMJQGI. You are receiving this because you authored the thread.Message ID: @.**>
根节点的判断应该是 newNode.type === NodeType.ROOT
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
修复由于页面自定义属性变更,Sortable配置中dataIdAttr有误导致拖拽页面调整排序后,点击源码或保存按钮后无效的情况