-
Notifications
You must be signed in to change notification settings - Fork 281
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
How to handle multiple animations on the same page #49
Comments
hey there, we were having this issue as well trying to get two instances from an exported JSON file to play the same animation with 2 different paths one for desktop and one for mobile. Is there a way to have 2 lottie wrappers on the same page to handle multiple animations? |
Hi everyone, i think i found a workaround to solve this issue (in my case works properly). Here's my solution: First i imported json data:
then i created an object in data() like this:
In lottie wrapper element i changed
then i added an additional parameter tho the
so i changed my methods according to populate main data()'s
Example of usage with
Hope that this can help someone :) |
Hey there! I found kinda same solution as @mdicampli but with different
Instead of using |
Can anybody please confirm they are able to run 5 or more animations in the same page without page turning unresponsive ? |
Yes, it's possible to implement many animations in the same page. |
有demo吗 |
I used simpler solution: LottieWrapper.vue
It needs unique name for each animation. |
vue-lottie 将动画转换为json的插件是嘛,我用过这个插件
…------------------ 原始邮件 ------------------
发件人: "chenqingspring/vue-lottie" ***@***.***>;
发送时间: 2021年12月23日(星期四) 中午12:51
***@***.***>;
***@***.******@***.***>;
主题: Re: [chenqingspring/vue-lottie] How to handle multiple animations on the same page (#49)
I used simpler solution:
LottieWrapper.vue
<template> <client-only> <Lottie v-bind="$attrs" :key="name" v-on="$listeners" /> </client-only> </template> <script> export default { components: { Lottie: process.client ? require('vue-lottie').default : null, }, props: { name: { type: String, required: true }, }, } </script>
It needs unique name for each animation.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you commented.Message ID: ***@***.***>
|
I am creating multiple lottie elements on the same page, but because the 'last' one added to the dom becomes the last
this.anim
only the last animation is working. What is the way to handle multiple animations on the same page correctly?The text was updated successfully, but these errors were encountered: