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

Using Element combined with vue to inject invalid values into the injectStyles attribute #6578

Closed
5 of 6 tasks
xhc-code opened this issue Apr 14, 2023 · 3 comments
Closed
5 of 6 tasks

Comments

@xhc-code
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

no

Bug description

I used the swiper-container to customize the web component through the Element method, and found that the injectStyles property was aligned and injected through the Vue method. This is a problem that the dom is bound to a string, and the style value of the array is passed.

For testing purposes, I set the array value directly to the injectStyles property, and the strings spliced ​​by commas are bound on the dom.

I'm pretty sure this is a problem with swiper's handling of this attribute when defining the Element component. Through the official demo, there is no problem with the cdn import method used, but the swiper installed through npm has this problem.

// In this example, view the properties bound by dom through the browser, and the result is
// el.injectStyles="1,2,3,4,5"
<swiper-container :inject-styles="[1,2,3,4,5]">
 …
</swiper-container>

At present, only the attribute injectStyles has been found to be problematic, and others have not been found yet.

The official website explains how to use it: https://swiperjs.com/element#usage-with-vue

Expected Behavior

normal injection style

Actual Behavior

cannot inject styles

Swiper version

9.2.0

Platform/Target and Browser Versions

Windows

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@xhc-code
Copy link
Author

The speed is so fast, that is to say, the current level of support for Element's web components is not enough?

@nolimits4web
Copy link
Owner

Sorry, what?

@xhc-code
Copy link
Author

Sorry, what?

It's okay, it's great

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