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

修复 当 v-infinite-scroll 释放的时候, SCOPE 不存在导致的错误 #14776

Closed
wants to merge 1 commit into from

Conversation

nianwu
Copy link

@nianwu nianwu commented Nov 7, 2023

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

Description

详见: #14775

Related Issue

Fixes #14775.

Explanation of Changes

🤖 Generated by Copilot at 3c0788e

  • Refactor code to use destructuring assignment for container and onScroll (link)

Copy link

👋 @nianwu, seems like this is your first time contribution to element-plus.

  • Please make sure that you have read our guidelines and code of conduct before making a contribution.
  • You can comment with /label Components:[component_name] to add a label for which component you are working on.
  • You may join our Discord for staying tuned.

@pull-request-triage pull-request-triage bot added 1st contribution Their very first contribution Needs Review labels Nov 7, 2023
Copy link

github-actions bot commented Nov 7, 2023

Copy link

github-actions bot commented Nov 7, 2023

Hello @nianwu, thank you for contributing to element-plus, please see our guideline to see how to make contribution

@chenxch
Copy link
Member

chenxch commented Nov 9, 2023

@nianwu 你是否介意重新修正下代码以及pr标题

@nianwu nianwu force-pushed the fix_infinite_scroll branch 2 times, most recently from a6bdcc6 to 744e736 Compare November 29, 2023 06:39
@nianwu
Copy link
Author

nianwu commented Nov 29, 2023

@chenxch 代码已经修复, 增加了 try_catch 防止出现其他的问题, 请查收

Copy link
Member

@chenxch chenxch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这可能会

packages/infinite-scroll/src/index.ts Outdated Show resolved Hide resolved
@nianwu nianwu closed this Nov 29, 2023
@chenxch chenxch reopened this Nov 29, 2023
@nianwu nianwu changed the title 修复 ##14775 修复 当 v-infinite-scroll 释放的时候, SCOPE 不存在导致的错误 Nov 29, 2023
@nianwu
Copy link
Author

nianwu commented Nov 29, 2023

@chenxch 这个标题可以么?

@chenxch
Copy link
Member

chenxch commented Nov 29, 2023

@chenxch 这个标题可以么?

ok~

@chenxch
Copy link
Member

chenxch commented Nov 29, 2023

@nianwu 需要解决一下冲突哦

@nianwu
Copy link
Author

nianwu commented Nov 29, 2023

@chenxch 请问这样可以了么? 我把我的分支 rebase 到了 dev 之后, 重新修复了一下代码。

@github-actions github-actions bot added the CommitMessage::Qualified Qualified commit message label Nov 30, 2023
Copy link

🧪 Playground Preview: https://element-plus.run/?pr=14776
Please comment the example via this playground if needed.

@kooriookami
Copy link
Member

@chenxch
image
很明显的两个错误

const { container, onScroll } = el[SCOPE]
if (SCOPE && el[SCOPE]) {
const container = el[SCOPE]
const onScroll = el[SCOPE]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const { container, onScroll } = el[SCOPE]

const onScroll = el[SCOPE]

container?.removeEventListener('scroll', onScroll)
}

container?.removeEventListener('scroll', onScroll)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除这行代码

@YiMo1
Copy link
Contributor

YiMo1 commented May 10, 2024

这个Bug已经修复,详情见 #16686

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Component] [infinite-scroll] 当 v-infinite-scroll 释放的时候, SCOPE 不存在导致的错误
4 participants