Skip to content

Commit dc6a79f

Browse files
committed
demo(vue: update
1 parent 1eadcd9 commit dc6a79f

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

demo-snippets/vue/ColorFilter.vue

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
<Label text="Simple Grid" />
55
</ActionBar>
66

7-
<GridLayout rows="*, auto, auto, auto, auto, auto">
8-
<NSImg backgroundColor="yellow" ref="opacityImg" stretch="aspectFill" placeholderImageUri="res://logo" :colorMatrix="colorMatrix" :src="src"> </NSImg>
9-
<Button text="nightVision" row="1" @tap="onSetNightVision"></Button>
10-
<Button text="polaroid" row="2" @tap="onSetPolaroid"></Button>
11-
<Button text="grayscale" row="1" @tap="onSetGrayscale"></Button>
12-
<Button text="bw" row="2" @tap="onSetBW"></Button>
13-
<Button text="change image" row="3" @tap="onChangeImage"></Button>
7+
<GridLayout rows="*, auto, auto">
8+
<NSZoomImg backgroundColor="yellow" ref="opacityImg" stretch="aspectFill" placeholderImageUri="res://logo" :colorMatrix="colorMatrix" :src="src"> </NSZoomImg>
9+
<StackLayout orientation="horizontal" row="1">
10+
<Button text="nightVision" row="1" @tap="onSetNightVision"></Button>
11+
<Button text="polaroid" @tap="onSetPolaroid"></Button>
12+
<Button text="grayscale" @tap="onSetGrayscale"></Button>
13+
<Button text="bw" @tap="onSetBW"></Button>
14+
<Button text="clear" @tap="onSetClear"></Button>
15+
</StackLayout>
16+
17+
<Button text="change image" row="2" @tap="onChangeImage"></Button>
1418
</GridLayout>
1519
</Page>
1620
</template>
@@ -62,6 +66,9 @@ export default {
6266
onSetBW(args) {
6367
this.colorMatrix = filters.bw
6468
},
69+
onSetClear(args) {
70+
this.colorMatrix = null
71+
},
6572
onChangeImage(){
6673
this.src= this.src=== '~/images/dessert.jpg' ? '~/images/drink.jpg': '~/images/dessert.jpg';
6774
}

0 commit comments

Comments
 (0)