Skip to content
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

[TreeTable] 通过 getParentRow 方法获取 InsertRow 的 Parent 得到 Windw 上下文 #2313

Open
Clover-You opened this issue Feb 18, 2024 · 1 comment
Labels
bug Something isn't working fix has been fix

Comments

@Clover-You
Copy link

可复现的链接:

https://codesandbox.io/p/sandbox/vxe-table-4-x-vue-3-0-wen-ti-yan-shi-forked-29384k?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clsr6kov100063b6lxmi68qv2%2522%252C%2522sizes%2522%253A%255B90%252C10%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clsr6kov100023b6ld191degh%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clsr6kov100033b6lbbe1cwwt%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clsr6kov100053b6l1g9petca%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clsr6kov100023b6ld191degh%2522%253A%257B%2522id%2522%253A%2522clsr6kov100023b6ld191degh%2522%252C%2522tabs%2522%253A%255B%255D%257D%252C%2522clsr6kov100053b6l1g9petca%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clsr6kov100043b6l8v6kp1qy%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A0%252C%2522path%2522%253A%2522%252F%2522%257D%255D%252C%2522id%2522%253A%2522clsr6kov100053b6l1g9petca%2522%252C%2522activeTabId%2522%253A%2522clsr6kov100043b6l8v6kp1qy%2522%257D%252C%2522clsr6kov100033b6lbbe1cwwt%2522%253A%257B%2522tabs%2522%253A%255B%255D%252C%2522id%2522%253A%2522clsr6kov100033b6lbbe1cwwt%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D

问题描述与截图:

通过 getParentRow 函数获取指定行的父级,如果该行是新增行那么会得到 Window 对象!!
原因是在插入并生成 data map 的时候,将 parent 内容记录为 parent ,由于未初始化该变量,导致 parent 内容指向了 Window 上下文。

源码内容传送门

f63ac0ce93592b2c5aa52869ec0e3353

截屏2024-02-18 下午3 13 07

期望的结果:

能够正常获取新增行 parent 信息

操作系统:

MacOS/Windows

浏览器版本:

Chrome 121.0.6167.139

vue 版本:

3.3.4

vxe-table 版本:

4.5.18

@Clover-You Clover-You added the bug Something isn't working label Feb 18, 2024
@Clover-You Clover-You changed the title [TreeTable] 通过 getParentRow 方法获取 InsertRow 的 Parent 得到 Windws 上下文 [TreeTable] 通过 getParentRow 方法获取 InsertRow 的 Parent 得到 Windw 上下文 Feb 18, 2024
@Clover-You
Copy link
Author

2024-02-18.4.24.23.mov

xuliangzhan added a commit that referenced this issue Feb 18, 2024
@xuliangzhan xuliangzhan added the fix has been fix label Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix has been fix
Projects
None yet
Development

No branches or pull requests

2 participants