Swiper Element (WebComponent) not working on vue3

33 Views Asked by At

Im trying to use the swiper element on vue3, following the doc's instructions, but it's not working. I did the 'npm install swiper' first and now my package.json has this info:

"dependencies": {
    "core-js": "^3.6.5",
    "swiper": "^11.0.7",
    "vue": "^3.0.0"
  },

But when I add the code below:

// import function to register Swiper custom elements
import { register } from 'swiper/element/bundle';
// register Swiper custom elements
register();

I got the following error:

This dependency was not found:

* swiper/element/bundle in ./src/main.js

Im trying this code inside my main.js file.

Something I'm missing?

Thanks in advance!

Im just following the docs instructions.

0

There are 0 best solutions below