-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathIndicator.vue
56 lines (53 loc) · 1.63 KB
/
Indicator.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
52
53
54
55
56
<template>
<Page>
<ActionBar>
<NavigationButton text="Back" android.systemIcon="ic_menu_back" @tap="$navigateBack" />
<Label text="Indicator" />
</ActionBar>
<GridLayout class="page" rows="*,auto">
<Pager ref="pager" id="pager" :items="items" :selectedIndex="selectedIndex" @selectedIndexChange="selectedIndexChange">
<v-template>
<GridLayout :backgroundColor="item.color">
<Label :text="item.title" />
</GridLayout>
</v-template>
</Pager>
<PagerIndicator pagerViewId="pager" type="fill" verticalAlignment="bottom" horizontalAlignment="center" marginBottom="10" />
<Button row="1" text="Reset" @tap="resetPager" />
</GridLayout>
</Page>
</template>
<script>
export default {
data() {
return {
selectedIndex: 2,
items: [
{ title: 'First', color: '#e67e22' },
{ title: 'Second', color: '#3498db' },
{ title: 'Third', color: '#e74c3c' },
{ title: 'Fourth', color: '#9b59b6' }
]
};
},
methods: {
resetPager() {
this.selectedIndex = 0;
},
selectedIndexChange(args) {
console.log('SELECTED INDEX CHANGES', args.value);
this.selectedIndex = args.value;
}
}
};
</script>
<style lang="scss" scoped>
.page Label {
font-size: 35;
text-align: center;
width: 100%;
vertical-alignment: center;
color: #ffffff;
text-transform: uppercase;
}
</style>