You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
450 B
31 lines
450 B
|
2 years ago
|
<template>
|
||
|
|
<view>
|
||
|
|
<view :animation="animationData">
|
||
|
|
<slot></slot>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
</template>
|
||
|
|
<script>
|
||
|
|
export default{
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
animationData: {},
|
||
|
|
animation : null
|
||
|
|
}
|
||
|
|
},
|
||
|
|
mounted : function(){
|
||
|
|
this.$emit('onMounted');
|
||
|
|
},
|
||
|
|
methods:{
|
||
|
|
setData : function(data){
|
||
|
|
this.animation = uni.createAnimation(data);
|
||
|
|
},
|
||
|
|
play : function(){
|
||
|
|
this.animationData = this.animation.export();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
<style>
|
||
|
|
</style>
|