Skip to content

Commit 289e99e

Browse files
committed
chore: doc/demo fix for transformers
1 parent 5eed813 commit 289e99e

File tree

4 files changed

+56
-2
lines changed

4 files changed

+56
-2
lines changed

demo-snippets/vue/BasicPager.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<Page>
33
<ActionBar>
4-
<NavigationButton text="Back" android.systemIcon="ic_menu_back" @tap="$navigateBack" />
4+
<NavigationButton text="Back" android.systemIcon="ic_menu_back" />
55
<Label text="Basic Pager" />
66
</ActionBar>
77

demo-snippets/vue/Transformer.vue

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<template>
2+
<Page>
3+
<ActionBar>
4+
<NavigationButton text="Back" android.systemIcon="ic_menu_back" />
5+
<Label text="Basic Pager" />
6+
</ActionBar>
7+
8+
<StackLayout class="page">
9+
<Pager for="item in items" height="100%" transformers="scale">
10+
<v-template>
11+
<GridLayout :backgroundColor="item.color">
12+
<Label :text="item.title" />
13+
</GridLayout>
14+
</v-template>
15+
</Pager>
16+
</StackLayout>
17+
</Page>
18+
</template>
19+
20+
<script>
21+
22+
import { Pager } from '@nativescript-community/ui-pager';
23+
import transformer from '@nativescript-community/ui-pager/transformers/Scale';
24+
25+
Pager.registerTransformer('scale', transformer)
26+
export default {
27+
data() {
28+
return {
29+
items: [
30+
{title: "First", color: "#e67e22"},
31+
{title: "Second", color: "#3498db"},
32+
{title: "Third", color: "#e74c3c"},
33+
{title: "Fourth", color: "#9b59b6"},
34+
]
35+
}
36+
}
37+
};
38+
</script>
39+
40+
<style lang="scss" scoped>
41+
42+
.page Label {
43+
font-size: 35;
44+
text-align: center;
45+
width: 100%;
46+
vertical-alignment: center;
47+
color: #ffffff;
48+
text-transform: uppercase;
49+
}
50+
51+
</style>

demo-snippets/vue/install.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Pager from '@nativescript-community/ui-pager/vue';
44
import StaticPager from './StaticPager.vue';
55
import BasicPager from './BasicPager.vue';
66
import Indicator from './Indicator.vue';
7+
import Transformer from './Transformer.vue';
78
import RenderIssue from './RenderIssue.vue';
89

910
export function installPlugin() {
@@ -14,6 +15,7 @@ export function installPlugin() {
1415
export const demos = [
1516
{ name: 'Static Pager', path: 'static', component: StaticPager },
1617
{ name: 'Basic Pager', path: 'basic', component: BasicPager },
18+
{ name: 'Transformer', path: 'Transformer', component: Transformer },
1719
{ name: 'Indicator', path: 'indicator', component: Indicator },
1820
{ name: 'Render Issue', path: 'indicator', component: RenderIssue }
1921
];

packages/ui-pager/blueprint.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Run the following command from the root of your project:
3535
| autoPlay | `boolean` |
3636
| disableSwipe | `boolean` |
3737
| showIndicator | `boolean` |
38+
| transformers | `string` |
3839

3940

4041
```
@@ -128,4 +129,4 @@ import transformer from '@nativescript-community/ui-pager/transformers/Scale';
128129

129130
Pager.registerTransformer('scale', transformer)
130131
```
131-
Then you can use that transformer with the `transformer` property of `Pager`
132+
Then you can use that transformer with the `transformers` property of `Pager`

0 commit comments

Comments
 (0)