http://www.vuevixens.org
Jen Looper
Senior Developer Advocate, Progress
Ex French Teacher
Co-Founder: Wellesley Chinese Language School
A framework for building native cross-platform mobile apps
No-compromise, smoothly-animating native mobile apps for iOS and Android
You know JavaScript? You know NativeScript!
Use JavaScript, CSS, XML to construct the app
Use no framework, Angular, or Vue.js!
+
=
Vue's 2.0 adoption of the virtual DOM enables native mobile rendering (Angular 2+ is similar)
Vue is lightweight so highly appropriate for mobile
Vue offers a great way for web developers to embrace mobile platforms via NativeScript or Weex
NativeScript and Vue have great code-sharing potential!
use of nativescript-vue
import Vue from 'vue';
import Vue from 'nativescript-vue';
<web>
{NativeScript}
Vue.js
NativeScript-Vue
NativeScript
bootstrapping the app
<web>
{NativeScript}
templates
<web>
{NativeScript}
Download the NativeScript playground app
(you'll also be prompted to download the NativeScript Preview app)
https://github.com/nativescript-vue/vue-cli-template
vue init nativescript-vue/vue-cli-template#next <project-name>
cd <project-name>
# Install dependencies
npm install
# Build!
tns run ios/android --bundle
Manage classrooms and assign texts for students to read aloud to perfect their accents
web
mobile
web
mobile
web
mobile
web
mobile
<- build folders
<- develop here
<- separate SFCs
<- shared service
<- separate entry points
<- folders for webpack
<- separate css
<template>
<Page class="Page">
<ActionBar title="🐕🐩🐕🐩🐕🐩🐕🐩🐕🐩🐕🐩🐕🐩" class="action-bar" />
<ScrollView>
<WrapLayout orientation="horizontal">
<StackLayout v-for="dog in dogsList" :key="dog" class="card">
<Image height="100%" width="48%" stretch="aspectFill" :src="dog" />
</StackLayout>
</WrapLayout>
</ScrollView>
</Page>
</template>
<script>
import service from "../shared/service.vue";
export default {
mixins: [service],
created() {
this.loadDogs();
}
};
</script>
<template>
<v-container grid-list-md fluid>
<v-layout wrap>
<v-flex xs6 sm4 md2 v-for="(dog, index) in dogsList" :key="dog">
<v-card>
<v-card-media
height="200px"
:src="dog"></v-card-media>
<v-card-actions>
...
</v-card-actions>
</v-card>
</v-flex>
</v-layout>
</v-container>
</template>
<script>
import service from '../shared/service.vue';
export default {
mixins: [service],
created() {
this.loadDogs();
},
};
</script>
This story is evolving! Follow along on Slack
https://github.com/tralves/ns-vue-codeshare-demo
https://github.com/jlooper/ns-vue-codeshare-demo
https://github.com/nativescript-vue/nativescript-vue
NativeScript Slack
With many thanks to Igor Randjelovic, core contributor
Thanks!
@jenlooper