8000 chore: fix a bunch of app test · tralves/nativescript-vue@661e36f · GitHub
[go: up one dir, main page]

Skip to content

Commit 661e36f

Browse files
committed
chore: fix a bunch of app test
1 parent 003e8ef commit 661e36f

File tree

6 files changed

+30
-27
lines changed

6 files changed

+30
-27
lines changed

samples/app/220.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ new Vue({
2121
template: `
2222
<Frame>
2323
<Page>
24-
<ActionBar title="Issue #127" />
24+
<ActionBar title="Issue #220" />
2525
<StackLayout>
2626
<Button @tap="counter++">{{counter}}</Button>
2727
<keep-alive>

samples/app/339.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let step1_id = 0
77
const Step1 = {
88
template: `
99
<Page class="page">
10-
<ActionBar title="Home" class="action-bar" />
10+
<ActionBar title="Issue #339" class="action-bar" />
1111
<StackLayout>
1212
<Label text="Welcome to step 1!" />
1313
<Button text="Thanks! Step 2 please." @tap="next" />

samples/app/344.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ let step1_id = 0
1313
const Step1 = {
1414
template: `
1515
<Page class="page">
16-
<ActionBar title="Home" class="action-bar" />
16+
<ActionBar title="Step 1" class="action-bar" />
1717
<StackLayout>
1818
<StackLayout>
1919
<Label class="m-t-30" text="Welcome to step 1!" />
20-
20+
2121
<CustomButton text="This button only works if you stay on this tab" @tap="next" />
22-
22+
2323
<CustomButton text="This button always works" @tap.native="next" />
2424
</StackLayout>
2525
</StackLayout>
@@ -49,7 +49,7 @@ const Step1 = {
4949
const Step2 = {
5050
template: `
5151
<Page class="page">
52-
<ActionBar title="Home" class="action-bar" />
52+
<ActionBar title="Step 2" class="action-bar" />
5353
<StackLayout>
5454
<Label text="Welcome to step 2!" />
5555
<Button text="Great, time for step 3." @tap="next" />
@@ -75,7 +75,7 @@ const Step2 = {
7575
const Step3 = {
7676
template: `
7777
<Page class="page">
78-
<ActionBar title="Home" class="action-bar" />
78+
<ActionBar title="Step 3" class="action-bar" />
7979
<StackLayout>
8080
<Label text="You made it to the last step!" />
8181
<Button text="Cool, start over." @tap="reset" />
@@ -101,7 +101,7 @@ const Step3 = {
101101
const FirstTab = {
102102
template: `
103103
<Page class="page">
104-
<ActionBar title="Home" class="action-bar" />
104+
<ActionBar title="Issue #344" class="action-bar" />
105105
<StackLayout>
106106
<Label class="m-t-30" textWrap="true" text="Tap on the second tab, then tap on this tab, and tap back over to the second tab. The top button will no longer work on the second tab's page."
107107
/>
@@ -121,7 +121,7 @@ const TabBar = {
121121
<Step1 />
122122
</Frame>
123123
<!--</keep-alive>-->
124-
124+
125125
<StackLayout class="tabbar" orientation="horizontal" row="0">
126126
<Label class="tabbar__item" @tap="screen = 0" text="First" :class='{"tabbar__item--active": screen == 0}' />
127127
<Label class="tabbar__item" @tap="screen = 1" text="Second" :class='{"tabbar__item--active": screen == 1}' />

samples/app/464.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Vue = require('./nativescript-vue')
1+
const Vue = require('nativescript-vue')
22
const {
33
ObservableArray
44
} = require('tns-core-modules/data/observable-array/observable-array')

samples/app/app-with-list-view.js

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const http = require('http')
33

44
Vue.config.debug = true
55
Vue.prototype.$http = http
6-
Vue.registerElement('gradient', () => require('nativescript-gradient').Gradient)
76

87
new Vue({
98
data: {
@@ -14,19 +13,21 @@ new Vue({
1413
},
1514

1615
template: `
16+
<Frame>
1717
<Page ref="page">
1818
<ActionBar :title="subreddit">
1919
<ActionItem android.systemIcon="ic_menu_refresh" ios.systemIcon="13" @tap="refresh" />
2020
<ActionItem text="change" android.position="popup" ios.position="right" @tap="chooseSubreddit" />
2121
</ActionBar>
22-
22+
2323
<StackLayout>
24-
<Gradient direction="to right" colors="#FF0077, red, #FF00FF" class="p-15">
24+
<StackLayout orientation="horizontal" class="p-15">
2525
<Label class="p-5 c-white" horizontalAlignment="center" text="You are browsing" textWrap="true" />
2626
<Label class="p-5 c-white" horizontalAlignment="center" :text="subreddit" textWrap="true" />
27-
</Gradient>
27+
</StackLayout>
2828
29-
<ListView for="item in items"
29+
<ListView
30+
for="item in items"
3031
class="list-group"
3132
separatorColor="red"
3233
@itemTap="onItemTap"
@@ -42,16 +43,17 @@ new Vue({
4243
</StackLayout>
4344
</StackLayout>
4445
</v-template>
45-
46+
4647
<v-template if="item.type === 'page'">
4748
<WrapLayout orientation="horizontal" class="list-group-item active">
4849
<Label :text="'<<< ' + item.title + ' >>>'" style="color: red;" />
4950
</WrapLayout>
5051
</v-template>
51-
52+
5253
</ListView>
5354
</StackLayout>
5455
</Page>
56+
</Frame>
5557
`,
5658

5759
created() {
@@ -69,13 +71,11 @@ new Vue({
6971
template: `
7072
<Page style="background-color: rgba(0, 0, 0, .6);">
7173
<StackLayout>
72-
<Label class="h2" textAlignment="center" textWrap="true" text="${
73-
item.title
74-
}" style="color: #fff; margin-top: 20" />
74+
<Label class="h2" textAlignment="center" textWrap="true" text="${item.title}" style="color: #fff; margin-top: 20" />
7575
<GridLayout rows="*, 60">
7676
<ActivityIndicator row="0" :busy="true" height="100" />
7777
<Image row="0" src="${item.fullImage}" />
78-
<Button row="1" @tap="$modal.close" text="Close" />
78+
<Button row="1" @tap="$modal.close" text="Close" />
7979
</GridLayout>
8080
</StackLayout>
8181
</Page>
@@ -122,20 +122,23 @@ new Vue({
122122
fetchItems() {
123123
this.$http
124124
.getJSON(
125-
`https://www.reddit.com/${
126-
this.subreddit
127-
}.json?limit=10&count=10&after=${this.last_page}`
125+
`https://www.reddit.com/${this.subreddit}.json?limit=10&count=10&after=${this.last_page}`
128126
)
129127
.then(res => {
130128
this.items.push({
131129
title: 'Page ' + this.page_num,
132130
type: 'page'
133131
})
132+
134133
res.data.children.forEach(item => {
134+
const fullImage = item.data.preview
135+
? item.data.preview.images[0].source.url
136+
: null
137+
const image = item.data.preview ? item.data.preview.thumbnail : null
135138
this.items.push({
136139
title: item.data.title,
137-
image: item.data.thumbnail,
138-
fullImage: item.data.preview.images[0].source.url,
140+
image: image,
141+
fullImage: fullImage,
139142
type: 'entry'
140143
})
141144
})

samples/app/app-with-v-template-components.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Vue.config.debug = true
77
// the framework should warn about this in the future!
88
Vue.component('CommentComp', {
99
props: ['comment'],
10-
template: `<label :text="comment.content"/>`
10+
template: `<Label :text="comment.content"/>`
1111
})
1212

1313
new Vue({

0 commit comments

Comments
 (0)
0