-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Swiper Vue as AsyncComponent #4613
Comments
same issue facing "vue": "^3.0.5", Same Error i am getting on if (!swiperRef.value) return;
this is the actual code where i am using Slider Component
This is my home page for sliders
Thanks in advance |
Solved:
changing this into
|
Hello @nolimits4web, thanks for a fix, however it fixes the issue only partially. I have updated the swiper version and tested it here: https://codesandbox.io/s/frosty-voice-dsfjb and the problem is, that you are not able to move to another slide until you resize the browser window. The issue is that We should find a way to wait for swiper-slide being loaded and then initialize swiper itself. |
@jan-vodila just enable observer:
|
What You Did
Load swiper as AsyncComponent
Expected Behavior
It should be possible to load Swiper only if needed through
defineAsyncComponent
method.Actual Behavior
It throws an error:
cannot read property 'value' of undefined
becauseswiperRef is undefined
, see:https://codesandbox.io/s/friendly-shape-0g0k8?file=/src/App.vue
The text was updated successfully, but these errors were encountered: