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

can we have a createElementWrapper method? #1095

Closed
wxsms opened this issue Nov 22, 2021 · 2 comments
Closed

can we have a createElementWrapper method? #1095

wxsms opened this issue Nov 22, 2021 · 2 comments

Comments

@wxsms
Copy link
Member

wxsms commented Nov 22, 2021

while building component lib or using teleport feature of Vue3, the HTML element sometimes goes out of the component. Although we can use getComponent to access it by VNode & component, but we don't want to always abstract anything into a component.

Therefore, it can be better if there's a function works like:

const wrapper = createElementWrapper(document.querySelector('.something'))

So I can still use the query or trigger features provided by VTU.

@lmiller1990
Copy link
Member

Would this be a better solution? As for rc.17 you can stub teleport and test your component like usual: #798 (comment)

If this won't work, please share a minimal test and we can explore some other solutions.

@wxsms
Copy link
Member Author

wxsms commented Nov 23, 2021

Thanks. It works great.

@wxsms wxsms closed this as completed Nov 23, 2021
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