Skip to content

Commit cdd7fda

Browse files
Merge pull request #1 from williamjuan027/refactor/vue-extra-layout
refactor: remove extra StackLayout
2 parents 2219f51 + 874fc1d commit cdd7fda

File tree

2 files changed

+40
-41
lines changed

2 files changed

+40
-41
lines changed

vue-demo/app/components/Details.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Image
88
margin="0"
99
stretch="aspectFill"
10-
:src="flick.image"></Image>
10+
:src="flick.image" />
1111
<StackLayout padding="10 20">
1212
<StackLayout v-for="detail in flick.details" :key="detail.id">
1313
<Label
@@ -16,12 +16,12 @@
1616
fontWeight="700"
1717
class="text-primary"
1818
textWrap="true"
19-
:text="detail.title"></Label>
19+
:text="detail.title" />
2020
<Label
2121
fontSize="14"
2222
class="text-secondary"
2323
textWrap="true"
24-
:text="detail.body"></Label>
24+
:text="detail.body" />
2525
</StackLayout>
2626
</StackLayout>
2727
</StackLayout>

vue-demo/app/components/Home.vue

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
11
<template>
22
<Page>
33
<ActionBar title="NativeFlix" />
4-
<StackLayout height="100%">
5-
<ListView
6-
height="100%"
7-
separatorColor="transparent"
8-
for="item in flicks"
9-
@itemTap="onFlickTap">
10-
<v-template>
11-
<GridLayout
12-
height="280"
13-
borderRadius="10"
14-
class="bg-secondary"
15-
rows="*, auto, auto"
16-
columns="*"
17-
margin="5 10"
18-
padding="0">
19-
<Image
20-
row="0"
21-
margin="0"
22-
stretch="aspectFill"
23-
:src="item.image"></Image>
24-
<Label
25-
row="1"
26-
margin="10 10 0 10"
27-
fontWeight="700"
28-
class="text-primary"
29-
fontSize="18"
30-
:text="item.title"></Label>
31-
<Label
32-
row="2"
33-
margin="0 10 10 10"
34-
class="text-secondary"
35-
fontSize="14"
36-
textWrap="true"
37-
:text="item.description"></Label>
38-
</GridLayout>
39-
</v-template>
40-
</ListView>
41-
</StackLayout>
4+
5+
<ListView
6+
height="100%"
7+
separatorColor="transparent"
8+
for="item in flicks"
9+
@itemTap="onFlickTap">
10+
<v-template>
11+
<GridLayout
12+
height="280"
13+
borderRadius="10"
14+
class="bg-secondary"
15+
rows="*, auto, auto"
16+
columns="*"
17+
margin="5 10"
18+
padding="0">
19+
<Image
20+
row="0"
21+
margin="0"
22+
stretch="aspectFill"
23+
:src="item.image" />
24+
<Label
25+
row="1"
26+
margin="10 10 0 10"
27+
fontWeight="700"
28+
class="text-primary"
29+
fontSize="18"
30+
:text="item.title" />
31+
<Label
32+
row="2"
33+
margin="0 10 10 10"
34+
class="text-secondary"
35+
fontSize="14"
36+
textWrap="true"
37+
:text="item.description" />
38+
</GridLayout>
39+
</v-template>
40+
</ListView>
4241
</Page>
4342
</template>
4443

0 commit comments

Comments
 (0)