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

uniapp平台app端报错 #54

Open
qlanto224 opened this issue Jul 23, 2020 · 3 comments
Open

uniapp平台app端报错 #54

qlanto224 opened this issue Jul 23, 2020 · 3 comments

Comments

@qlanto224
Copy link

uniapp平台app端报错如下:
image
测试demo:

<template>
	<div>
		<canvas id="test-canvas" canvas-id="test-canvas"></canvas>
	</div>
</template>
<script>
	import Anim from "../../assets/data.json"
	import lottie from "lottie-web";

	export default {
		onLoad() {
			let that = this;
			const canvasContext = uni.createCanvasContext("test-canvas");
			// 指定canvas大小
			canvasContext.canvas = {
				width: 100,
				height: 100,
			};
			lottie.loadAnimation({
				container: uni.createSelectorQuery().select("#test-canvas"),
				renderer: "canvas", 
				loop: true,
				autoplay: true,
				animationData: Anim,
				rendererSettings: {
					context: canvasContext,
					scaleMode: 'noScale',
					clearCanvas: false,
				},
			});
		},
	}
</script>

@notjb
Copy link

notjb commented Jul 23, 2020

➡️ #20 (comment)

@qlanto224
Copy link
Author

➡️ #20 (comment)

并没有什么用

@MichelleWangMX
Copy link

我也有同樣的問題

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants