Skip to content

Instantly share code, notes, and snippets.

@MSergiu7
Last active February 21, 2019 14:35
Show Gist options
  • Save MSergiu7/dcce168d74528194329b9fd419303e4e to your computer and use it in GitHub Desktop.
Save MSergiu7/dcce168d74528194329b9fd419303e4e to your computer and use it in GitHub Desktop.
import Vue from 'nativescript-vue';
import App from './components/App';
import VueDevtools from 'nativescript-vue-devtools';
if(TNS_ENV !== 'production') {
Vue.use(VueDevtools);
}
// Prints Vue logs when --env.production is *NOT* set while building
Vue.config.silent = (TNS_ENV === 'production');
Vue.registerElement('LottieView', () => require('nativescript-lottie').LottieView);
new Vue({
render: h => h('frame', [h(App)]),
store
}).$start();
<template>
<Page>
<ActionBar title="Animation"/>
<StackLayout>
<LottieView height="130" src="pinjump.json" :loop="true" :autoPlay="true" @loaded="lottieViewLoaded"></LottieView>
</StackLayout>
</Page>
</template>
<script>
export default {
data() {
return {
_lottieView: null,
}
},
methods: {
lottieViewLoaded(args) {
console.log('asdsad');
this._lottieView = args.object;
},
},
created() {
console.log('animation page');
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment