Code Monkey home page Code Monkey logo

weexlottie's Introduction

WXLottie

Pod version

WXLottie is a weex component plugin using lottie

weex-toolkit version: >= 1.2.0 WeexSDK : >= 0.15.1

WeexLottie

lottie project

WeexLottie

example

usage:

Examples:

<template>
  <div style='margin-top:50px;margin-left:150px'>
	<text style='margin-left:150px;border-width:2px;width:80px;' @click='click' :value="status"></text>
    <lottie src='http://127.0.0.1:12580/examples/animations/LottieWalkthrough.json' loop=true style='width:300px;height:300px'  ref='lottie'></lottie>
	<lottie src='http://127.0.0.1:12580/examples/animations/MotionCorpse-Jrcanest.json' loop=true style='width:300px;height:300px'  ref='lottie1'></lottie>
  </div>
</template>

<script>
  module.exports = {
    data: {
      play:false,
	  status:"play"
    },
    methods: {
      click : function(e) {
        var lottie = this.$refs.lottie;
		var lottie1 = this.$refs.lottie1;
        if (this.play) {
          this.play = false;
          lottie.reset();
	  lottie1.reset();
	  this.status = "play";
        }else {
          this.play = true;
          lottie.play();
	  lottie1.play();
	  this.status='stop'
        }
      }
    }
  }  
</script>

integrate to your project

WXLottie for iOS

  • Integrate by weex
weex plugin add weex-plugin-lottie
  • Integrate with cocoaPods
    1. Add the follow in your Podfile
      pod 'WXLottie'
      
    2. Register this weex component after init weexSDK env

WXLottie for Android

  • Integrate by weex
weex plugin add weex-plugin-lottie
  • Integrate with maven
compile 'org.asialee.weex:weexplugin:1.0.0'
  • Integrate with source code:
  1. Move WXLottie.java in your project
  2. Integrate lottie:
compile "com.airbnb.android:lottie:2.3.1"

Then do not forget to regiter WXLottie in your Application:

WXSDKEngine.registerComponent("lottie", WXLottie.class);

WXLottie for Web

  • Integrate by weex
weex plugin add weex-plugin-lottie
  • Integrate with npm
npm i weex-plugin-lottie --save

Then do not forget to regiter weex-plugin-lottie in your web entry like blow

import Vue from 'vue';

import weex from 'weex-vue-render';

import weex-plugin-lottie from 'weex-plugin-lottie';

weex.init(Vue);

weex.install(weex-plugin-lottie)

const App = require('./index.vue');
App.el = '#root';
new Vue(App);

 

weexlottie's People

Contributors

acton393 avatar erha19 avatar stellanhaglund avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.