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

子应用当中使用 addEventListener ,scroll 事件回调 event 中无法拿到 target,输出为 null #924

Open
1946578780 opened this issue Nov 26, 2024 · 1 comment

Comments

@1946578780
Copy link

微信图片_20241126181519

@wangjinmeng
Copy link

解决办法在父组件中给wujie组件传入plugins

const plugins = [
    {
        jsBeforeLoaders: [
            {
                content: `
                window.addEventListener = (...params) => {window?.$wujie?.shadowRoot.addEventListener(...params)};
                window.removeEventListener = (...params) => {window?.$wujie?.shadowRoot.removeEventListener(...params)};
                `
            }
        ]
    }
]

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

No branches or pull requests

2 participants