Comments (3)
I am using Nuxt 3 and have added it as a plugin
/plugins/flipbook-vue.ts
import FlipBook from "flipbook-vue";
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.component("FlipBook", FlipBook);
});
from flipbook-vue.
@Vectoras It doesn't seem to work with me, can you give me an example please?
[Vue warn]: Unhandled error during execution of render function
at <Flipbook key=0 pages=
Array(7) [ "https://alzawraapaper.com/vrsfls/cntnt/pctr/42366.jpg", "https://alzawraapaper.com/vrsfls/cntnt/pctr/42366.jpg", "https://alzawraapaper.com/vrsfls/cntnt/pctr/42366.jpg", "https://alzawraapaper.com/vrsfls/cntnt/pctr/42366.jpg", "https://alzawraapaper.com/vrsfls/cntnt/pctr/42366.jpg", "https://alzawraapaper.com/vrsfls/cntnt/pctr/42366.jpg", "https://alzawraapaper.com/vrsfls/cntnt/pctr/42366.jpg" ]
>
at <Index onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref<
Proxy { <target>: Proxy, <handler>: {…} }
> >
at <RouteProvider key="/ar/newspaper" vnode=
Object { __v_isVNode: true, __v_skip: true, type: {…}, props: {…}, key: null, ref: {…}, scopeId: null, slotScopeIds: null, children: null, component: null, … }
route=
Object { fullPath: "/ar/newspaper", hash: "", query: {}, name: "newspaper___ar", path: "/ar/newspaper", params: {}, matched: (1) […], meta: Proxy, redirectedFrom: undefined, href: "/ar/newspaper" }
... >
at <RouterView name=undefined route=undefined >
at <NuxtPage>
at <Default ref=Ref<
Proxy { <target>: {…}, <handler>: {…} }
> >
at <LayoutLoader key="default" layoutProps=
Object { ref: {…} }
name="default" >
at <NuxtLayoutProvider layoutProps=
Object { ref: {…} }
key="default" name="default" ... >
at <NuxtLayout>
at <App key=3 >
at <NuxtRoot> [deps:1449:13](http://localhost:3000/_nuxt/node_modules/.cache/vite/client/deps/)
[Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core
at <Flipbook key=0 pages=
Array(7) [ "https://alzawraapaper.com/vrsfls/cntnt/pctr/42366.jpg", "https://alzawraapaper.com/vrsfls/cntnt/pctr/42366.jpg", "https://alzawraapaper.com/vrsfls/cntnt/pctr/42366.jpg", "https://alzawraapaper.com/vrsfls/cntnt/pctr/42366.jpg", "https://alzawraapaper.com/vrsfls/cntnt/pctr/42366.jpg", "https://alzawraapaper.com/vrsfls/cntnt/pctr/42366.jpg", "https://alzawraapaper.com/vrsfls/cntnt/pctr/42366.jpg" ]
>
at <Index onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref<
Proxy { <target>: Proxy, <handler>: {…} }
> >
at <RouteProvider key="/ar/newspaper" vnode=
Object { __v_isVNode: true, __v_skip: true, type: {…}, props: {…}, key: null, ref: {…}, scopeId: null, slotScopeIds: null, children: null, component: null, … }
route=
Object { fullPath: "/ar/newspaper", hash: "", query: {}, name: "newspaper___ar", path: "/ar/newspaper", params: {}, matched: (1) […], meta: Proxy, redirectedFrom: undefined, href: "/ar/newspaper" }
... >
at <RouterView name=undefined route=undefined >
at <NuxtPage>
at <Default ref=Ref<
Proxy { <target>: {…}, <handler>: {…} }
> >
at <LayoutLoader key="default" layoutProps=
Object { ref: {…} }
name="default" >
at <NuxtLayoutProvider layoutProps=
Object { ref: {…} }
key="default" name="default" ... >
at <NuxtLayout>
at <App key=3 >
at <NuxtRoot> [deps:1449:13](http://localhost:3000/_nuxt/node_modules/.cache/vite/client/deps/)
Uncaught (in promise) TypeError: Expected a `number[]` with length 6 or 16.
NuxtJS 67
from flipbook-vue.
Achieve to make it work in a plugin
The edit is in the StackOverflow answer, don't really see the point of copy-pasting exactly the same thing here.
Both syntaxes are working tho so that's nice! It is using the 1.0.0-beta.4
too!
The solution is on this issue on StackOverflow.
Using 1.0.0-alpha.4
, looks like it infinite loops. Some help from the maintainers would be welcome.
But at the same time, it was always quite tricky to pull off in general haha.
So yeah, I gave up on the idea of having a plugin, and made it local rather.
Hopefully the package still works as a bare component in a .vue
file directly.
<script setup>
import Flipbook from 'flipbook-vue'
</script>
<template>
<Flipbook class="flipbook" :pages="['https://source.unsplash.com/random/400x400?sig=1', 'https://source.unsplash.com/random/400x400?sig=2', 'https://source.unsplash.com/random/400x400?sig=3', 'https://source.unsplash.com/random/400x400?sig=4', 'https://source.unsplash.com/random/400x400?sig=5']" />
</template>
<style scoped>
.flipbook {
width: auto;
height: 500px;
}
</style>
PS: not sure why my Nuxt app just froze a few times ❄️, probably because I tried to do too many things and Nuxt was kinda confused. Even if I cleared the .nuxt
folder etc. Eh, works now! 🤷🏻♂️ 💪🏻
from flipbook-vue.
Related Issues (20)
- Nuxt error when going backwards
- startPage toggle page HOT 5
- Duplicate image names cause the animation to switch abnormally. HOT 2
- examples/demo is bad
- How to change this color?Thanks
- Getting Maximum recursive updates exceeded when trying to use the library HOT 5
- Flipbook functionality break
- Question: How to implement flip on click? HOT 2
- Cannot build using Vue 3 HOT 1
- Import flipbook-vue/vue2 not recognized HOT 7
- How to setup touch&swipe for images inside viewport. HOT 1
- Failing importing vue2 version HOT 5
- Next pages show current page instead of loader when flipping HOT 8
- Installation new flipbook HOT 1
- How to add pdfs and epubs? HOT 2
- Background transparent on flipped page animation HOT 2
- Switching pages fast with arrow keys messes up the images HOT 2
- Error when using flipbook-vue in nuxt
- Force odd/even pages to show on certain side of the flipbook HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flipbook-vue.