-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
Mixins.vue
51 lines (44 loc) · 1.68 KB
/
Mixins.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<template>
<Page>
<ActionBar :title="title">
<NavigationButton text="Back" android.systemIcon="ic_menu_back" @tap="onNavigationButtonTap"></NavigationButton>
</ActionBar>
<StackLayout>
<Button margin="10" rippleColor="red" backgroundColor="green" borderRadius="10" fontSize="20" text="elevated button" />
<Button margin="10" rippleColor="red" fontSize="20" text="elevated button" />
<Label margin="10" horizontalAlignment="center" backgroundColor="yellow" padding="10" elevation="1" borderRadius="20" rippleColor="red" text="elevated text" />
<Label margin="10" horizontalAlignment="center" padding="10" backgroundColor="yellow" dynamicElevationOffset="3" elevation="1" rippleColor="red" text="elevated text" />
<StackLayout class="cardView" height="100" orientation="horizontal" >
<Label width="100%" textAlignment="center" verticalAlignment="center" text="elevated text" />
</StackLayout>
</StackLayout>
</Page>
</template>
<script lang="ts">
import * as frameModule from '@nativescript/core/ui/frame';
import Vue from 'vue';
export const title = 'Mixins sample';
export default Vue.extend({
name: 'Mixins',
data() {
return {
title: title,
value: 50
};
},
methods: {
onNavigationButtonTap() {
frameModule.topmost().goBack();
}
},
created() {
this.interval = setInterval(() => {
const newValue = (this.value + 1) % 100;
this.value = newValue;
}, 100);
},
beforeDestroy() {
clearInterval(this.interval);
}
});
</script>