提交 5e48e113 编写于 作者: DCloud-yyl's avatar DCloud-yyl

update animation-view.md

上级 e93717ba
...@@ -51,21 +51,23 @@ Lottie动画组件,动画资源参考[Lottie官方接](https://airbnb.design/l ...@@ -51,21 +51,23 @@ Lottie动画组件,动画资源参考[Lottie官方接](https://airbnb.design/l
export default { export default {
data() { data() {
return { return {
path: "/uni_modules/uni-animation-view/static/lottie.json", path: 'https://b.bdstatic.com/miniapp/images/lottie_example_one.json',
loop: false, loop: false,
autoplay: false, autoplay: false,
action: "play", action: 'play',
hidden: false, hidden: false,
status: "暂停" status: '暂停'
} }
}, },
methods: { methods: {
playLottie() { playLottie() {
this.action = ('pause' === this.action) ? 'play' : 'pause'; this.action = ('play' !== this.action) ? 'play' : 'pause';
this.status = ('pause' === this.action) ? '播放' : '暂停'; this.status = ('pause' === this.action) ? '播放' : '暂停';
}, },
lottieEnd() { lottieEnd() {
console.log("动画播放结束"); this.status = '播放';
this.action = 'stop';
console.log('动画播放结束');
} }
} }
} }
...@@ -73,8 +75,10 @@ Lottie动画组件,动画资源参考[Lottie官方接](https://airbnb.design/l ...@@ -73,8 +75,10 @@ Lottie动画组件,动画资源参考[Lottie官方接](https://airbnb.design/l
<style> <style>
.animation { .animation {
width: 750px; width: 750rpx;
height: 300px; height: 300rpx;
background-color: #FF0000;
margin-bottom: 20px;
} }
</style> </style>
``` ```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册