Skip to content

Commit 2850ce9

Browse files
committed
Add Vue.js demo
1 parent e0d535b commit 2850ce9

File tree

79 files changed

+1026
-41
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1026
-41
lines changed

.travis.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,23 @@ android:
88
- sys-img-armeabi-v7a-android-21
99

1010
before_install:
11-
- sudo pip install --upgrade pip
12-
- sudo pip install six
11+
- sudo pip install --upgrade pip
12+
- sudo pip install six
1313

1414
install:
15-
- echo no | npm install -g nativescript
16-
- tns usage-reporting disable
17-
- tns error-reporting disable
18-
- cd src
19-
- npm i
20-
- npm run compile
21-
- cd ../demo
22-
- npm i
23-
- cd ../demo-angular
24-
- npm i
25-
- cd ..
15+
- echo no | npm install -g nativescript
16+
- tns usage-reporting disable
17+
- tns error-reporting disable
18+
- cd src
19+
- npm i
20+
- npm run compile
21+
- cd ../demo
22+
- npm i
23+
- cd ../demo-angular
24+
- npm i
25+
- cd ../demo-vue
26+
- npm i
27+
- cd ..
2628

2729
matrix:
2830
include:
@@ -60,6 +62,8 @@ matrix:
6062
- tns build android --bundle --env.uglify --env.snapshot
6163
- cd ../demo-angular
6264
- tns build android --bundle --env.uglify --env.snapshot --env.aot
65+
- cd ../demo-vue
66+
- tns build android --bundle --env.uglify --env.snapshot
6367
- language: android
6468
os: linux
6569
dist: precise
@@ -102,6 +106,8 @@ matrix:
102106
- tns build ios --bundle --env.uglify
103107
- cd ../demo-angular
104108
- tns build ios --bundle --env.uglify --env.aot
109+
- cd ../demo-vue
110+
- tns build ios --bundle --env.uglify
105111
- os: osx
106112
osx_image: xcode10.0
107113
language: node_js

demo-angular/tsconfig.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
{
2-
"compilerOptions": {
3-
"module": "commonjs",
4-
"target": "es5",
5-
"experimentalDecorators": true,
6-
"emitDecoratorMetadata": true,
7-
"noEmitHelpers": true,
8-
"noEmitOnError": true,
9-
"lib": [
10-
"es6",
11-
"dom",
12-
"es2015.iterable"
13-
],
14-
"baseUrl": ".",
15-
"paths": {
16-
"*": [
17-
"./node_modules/tns-core-modules/*",
18-
"./node_modules/*"
19-
],
20-
"~/*": [
21-
"app/*"
22-
]
23-
}
24-
},
25-
"exclude": [
26-
"node_modules",
27-
"platforms"
28-
]
29-
}
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"target": "es5",
5+
"experimentalDecorators": true,
6+
"emitDecoratorMetadata": true,
7+
"noEmitHelpers": true,
8+
"noEmitOnError": true,
9+
"lib": [
10+
"es6",
11+
"dom",
12+
"es2015.iterable"
13+
],
14+
"baseUrl": ".",
15+
"paths": {
16+
"*": [
17+
"./node_modules/tns-core-modules/*",
18+
"./node_modules/*"
19+
],
20+
"~/*": [
21+
"app/*"
22+
]
23+
}
24+
},
25+
"exclude": [
26+
"node_modules",
27+
"platforms"
28+
]
29+
}

demo-vue/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/app/resources/Android/**/strings.xml
2+
/app/resources/iOS/**/InfoPlist.strings
3+
/app/resources/iOS/**/Localizable.strings
4+
/hooks/
5+
/node_modules/
6+
/package-lock.json
7+
/platforms/

demo-vue/app/app.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Global SCSS styling
2+
// @see https://docs.nativescript.org/ui/styling
8.22 KB
Loading

demo-vue/app/components/App.vue

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<template>
2+
<Page>
3+
<ActionBar :title="'app.name' | L"></ActionBar>
4+
<ScrollView>
5+
<StackLayout>
6+
<Label :text="'hello.world' | L"></Label>
7+
<Label :text="'sprintf' | L"></Label>
8+
<Label :text="'sprintf' | L('PARTIALLY')"></Label>
9+
<Label :text="'sprintf' | L('AGAIN', 'OK')"></Label>
10+
<Label :text="'sprintf.numbered.placeholders' | L('1', '2')"></Label>
11+
<Label :text="'array' | L"></Label>
12+
<Label :text="'this.key.does.not.exist' | L"></Label>
13+
<Label :text="'html' | L"></Label>
14+
<Label :text="'new.line' | L"></Label>
15+
<Label :text="'new.line' | L" textWrap="true"></Label>
16+
<Label :text="'tab' | L" textWrap="true"></Label>
17+
<Label :text="'special.characters.n' | L" textWrap="true"></Label>
18+
<Label :text="'special.characters.r' | L" textWrap="true"></Label>
19+
<Label :text="'special.characters.t' | L" textWrap="true"></Label>
20+
<Label :text="'special.characters.backslash' | L" textWrap="true"></Label>
21+
<Label :text="'special.characters.single.quote' | L" textWrap="true"></Label>
22+
<Label :text="'special.characters.double.quote' | L" textWrap="true"></Label>
23+
<Label :text="'special.keys.\n' | L" textWrap="true"></Label>
24+
<Label :text="'special.keys.\r' | L" textWrap="true"></Label>
25+
<Label :text="'special.keys.\t' | L" textWrap="true"></Label>
26+
<Label :text="'special.keys.\\' | L" textWrap="true"></Label>
27+
<Label :text="'special.keys.\'' | L" textWrap="true"></Label>
28+
<Label :text="'special.keys.&quot;' | L" textWrap="true"></Label>
29+
</StackLayout>
30+
</ScrollView>
31+
</Page>
32+
</template>
33+
34+
<style scoped>
35+
Label {
36+
border-color: #cccccc;
37+
border-width: 1;
38+
margin-bottom: 10;
39+
padding: 5;
40+
}
41+
</style>

demo-vue/app/fonts/.gitkeep

Whitespace-only changes.

demo-vue/app/i18n/en.default.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const translations = require("../../../demo/app/i18n/en.default");
2+
translations["app.name"] = "NSL VUE Demo";
3+
module.exports = translations;

demo-vue/app/main.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { localize } from "nativescript-localize";
2+
import Vue from "nativescript-vue";
3+
4+
import App from "./components/App.vue";
5+
6+
Vue.config.silent = (TNS_ENV === "production");
7+
Vue.filter("L", localize);
8+
9+
new Vue({
10+
render: h => h("frame", [h(App)])
11+
}).$start();

demo-vue/app/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"android": {
3+
"v8Flags": "--expose_gc",
4+
"requireModules": ["nativescript-localize"]
5+
},
6+
"main": "main",
7+
"name": "nativescript-localize-demo-vue",
8+
"version": "1.0.0"
9+
}

0 commit comments

Comments
 (0)