flowbite-vue icon indicating copy to clipboard operation
flowbite-vue copied to clipboard

Nuxt 2 - JS not working

Open RafaElZgz opened this issue 3 years ago • 5 comments

I create a Nuxt 2 project (latest stable version) and I can not make Flowbite works in it. The components are rendering ok but all the JS part does not work. In my case I can not even make a funcional navbar with the given components, the menu button for smartphones do nothing when clicked.

I followed the install steps of flowbite-vue, I also try to use it via CDN and I read this issue from the main repository and others on the web, anything worked for me.

Also have no errors on the chrome console or CMD from VS.

RafaElZgz avatar Aug 24 '22 00:08 RafaElZgz

@RafaElZgz I'm shooting in the dark here, since I'm not sure if it's required, but have you included the JS file?

<script src="../path/to/flowbite/dist/flowbite.js"></script>

xeno avatar Aug 25 '22 23:08 xeno

@RafaElZgz I'm shooting in the dark here, since I'm not sure if it's required, but have you included the JS file?

<script src="../path/to/flowbite/dist/flowbite.js"></script>

Yes, on nuxt.config.js:

head: { script: [ { src: "https://unpkg.com/[email protected]/dist/flowbite.js", body: true, }, ], }

RafaElZgz avatar Aug 26 '22 01:08 RafaElZgz

While trying to set up a test case, I couldn't even get flowbite-vue to install, since it requires vue 3 and nuxt 2 uses vue 2. Did you install it only through the CDN? Or did you use npm?

xeno avatar Aug 26 '22 03:08 xeno

While trying to set up a test case, I couldn't even get flowbite-vue to install, since it requires vue 3 and nuxt 2 uses vue 2. Did you install it only through the CDN? Or did you use npm?

I could without errors in console. Did not even know it requires vue 3. Despite that I tried to install via CDN as showed on my first response and nothing happends, did not work.

RafaElZgz avatar Aug 26 '22 10:08 RafaElZgz

Unfortunately, because Vue 3 is the basis for flowbite-vue, I don't think this library will work for a Nuxt 2 or Vue 2 project.

xeno avatar Aug 26 '22 14:08 xeno

Hey, flowbite-vue will work only with vue 3 and nuxt 3

cogor avatar Dec 18 '22 10:12 cogor