Skip to content

Commit 80711f8

Browse files
committed
test: demo update
1 parent 6d5d6e9 commit 80711f8

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

demo-vue/app/components/Home.vue

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@
55
</ActionBar>
66

77
<GridLayout rows="*, auto, auto, auto, auto, auto">
8-
<NSImg
9-
ref="opacityImg"
10-
verticalAlignment="center"
11-
borderRadius="100"
12-
placeholderImageUri="res://ns_logo"
13-
src="https://raw.githubusercontent.com/nativescript-community/ui-image/master/examples-data/breakfast1.jpg"
14-
>
15-
</NSImg>
8+
<StackLayout orientation="horizontal">
9+
<NSImg backgroundColor="yellow" height="100" ref="opacityImg" verticalAlignment="center" borderRadius="100" width="50%" stretch="aspectFill" placeholderImageUri="res://ns_logo" src="~/images/dessert.jpg"> </NSImg>
10+
<NSImg backgroundColor="red" width="50%" height="100" verticalAlignment="center" borderRadius="100" stretch="aspectFill" :src="imgSource" > </NSImg>
11+
</StackLayout>
1612
<Button text="Set 1" row="1" @tap="onSeOpacityTo1"></Button>
1713
<Button text="Set 0.5" row="2" @tap="onSeOpacityTo05"></Button>
1814
<Button text="Set 0.1" row="3" @tap="onSeOpacityTo01"></Button>
@@ -23,7 +19,13 @@
2319
</template>
2420

2521
<script>
22+
import { ImageSource } from '@nativescript/core';
2623
export default {
24+
data: function() {
25+
return {
26+
imgSource: ImageSource.fromFileSync('~/images/dessert.jpg')
27+
};
28+
},
2729
methods: {
2830
onSeOpacityTo1(args) {
2931
this.$refs.opacityImg.nativeView.opacity = 1;

0 commit comments

Comments
 (0)