File tree Expand file tree Collapse file tree 6 files changed +48
-1
lines changed Expand file tree Collapse file tree 6 files changed +48
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"presets" : [" es2015" , " stage-0" ],
3
3
"plugins" : [
4
+ " transform-runtime" ,
4
5
" add-module-exports" ,
5
6
" transform-object-rest-spread" ,
6
7
" syntax-dynamic-import" ,
Original file line number Diff line number Diff line change 11
11
"dependencies" : {
12
12
"extend" : " ^3.0.0" ,
13
13
"lodash" : " ^4.17.4" ,
14
+ "lottie-web" : " ^5.4.2" ,
14
15
"moment" : " ^2.17.1" ,
15
16
"vue" : " ^2.5.17" ,
16
17
"weex-amui" : " ^0.1.1" ,
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div
3
+ ref =" lavContainer"
4
+ ></div >
5
+ </template >
6
+
7
+ <script >
8
+ import lottie from ' lottie-web'
9
+
10
+ export default {
11
+ props: {
12
+ options: Object ,
13
+ autoplay: {
14
+ type: Boolean ,
15
+ default: true
16
+ },
17
+ loop: {
18
+ type: [Boolean , String ],
19
+ default: true
20
+ },
21
+ src: String
22
+ },
23
+
24
+ async mounted () {
25
+ let otherOptions = {
26
+ container: this .$refs .lavContainer .$el ,
27
+ renderer: ' svg' ,
28
+ prerender: true ,
29
+ loop: this .loop !== false ,
30
+ autoplay: this .autoplay !== false ,
31
+ path: this .src
32
+ }
33
+ this .anim = lottie .loadAnimation (otherOptions)
34
+ this .$emit (' animCreated' , this .anim )
35
+ }
36
+ }
37
+ </script >
Original file line number Diff line number Diff line change 3
3
<div class =" panel" >
4
4
<text class =" text" >Weex 是一套简单易用的跨平台开发方案,能以 Web 的开发体验构建高性能、可扩展的原生应用。</text >
5
5
</div >
6
+ <!-- <lottie style='width:200px;height:200px;border-width:2px;' loop=true src="local://lottie/coinpig.json" />
7
+ <lottie style='width:200px;height:200px;border-width:2px;' loop=true src="local://lottie/motorcycle.json" /> -->
8
+ <lottie style =' width :200px ;height :200px ;border-width :2px ;' loop =true src =" https://www.lottiefiles.com/storage/datafiles/nwHJNOUoNltzK7d/data.json" />
6
9
</scroller >
7
10
</template >
8
11
26
29
font-size : 32px ;
27
30
}
28
31
29
- </style >
32
+ </style >
Original file line number Diff line number Diff line change 1
1
import Vue from 'vue'
2
2
window . Vue = Vue
3
3
require ( 'weex-vue-render' )
4
+ Vue . component ( 'lottie' , require ( '@components/lottie.vue' ) . default )
Original file line number Diff line number Diff line change @@ -6098,6 +6098,10 @@ loose-envify@^1.0.0:
6098
6098
dependencies :
6099
6099
js-tokens "^3.0.0 || ^4.0.0"
6100
6100
6101
+ lottie-web@^5.4.2 :
6102
+ version "5.4.2"
6103
+ resolved "http://192.168.200.235:8282/repository/findnpmgroup/lottie-web/-/lottie-web-5.4.2.tgz#efe727ce20170946969929b50f30bfef3ec7ae55"
6104
+
6101
6105
loud-rejection@^1.0.0 :
6102
6106
version "1.6.0"
6103
6107
resolved "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f"
You can’t perform that action at this time.
0 commit comments