Skip to content
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

feat: add asset path #307

Merged
merged 1 commit into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/vue3-lottie/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ More detailed explanations are provided in the [documentation](https://vue3-lott
| backgroundColor | String | transparent | Background color of the container |
| renderer | String | "svg" | Set the renderer |
| rendererSettings | Object | {} | Options for if you want to use an existing canvas to draw (can be ignored on most cases) |
| assetsPath | String | '' | Set the assets path for the animation |

# Events

Expand Down
6 changes: 6 additions & 0 deletions packages/vue3-lottie/src/vue3-lottie.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface LottieProps {
playOnHover: boolean
backgroundColor: string
pauseAnimation: boolean
assetsPath: string
}

export default defineComponent({
Expand Down Expand Up @@ -100,6 +101,10 @@ export default defineComponent({
type: Object as PropType<LottieProps['rendererSettings']>,
default: () => ({}),
},
assetsPath: {
type: String as PropType<LottieProps['assetsPath']>,
default: '',
},
},

emits: {
Expand Down Expand Up @@ -168,6 +173,7 @@ export default defineComponent({
loop: loop,
autoplay: autoPlay,
animationData: animationData,
assetsPath: props.assetsPath,
}

if (isEqual(props.rendererSettings, {}) === false) {
Expand Down