-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathAllSides.vue
55 lines (46 loc) · 2.02 KB
/
AllSides.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
<template>
<Page>
<ActionBar>
<NavigationButton text="Back" @tap="$navigateBack" />
<Label text="All Sides" />
</ActionBar>
<Drawer ref="drawer">
<GridLayout ~leftDrawer class="drawer" width="65%" height="100%" backgroundColor="white" padding="25">
<Label text="Left Drawer" verticalAlignment="top" />
</GridLayout>
<GridLayout ~rightDrawer class="drawer" width="65%" height="100%" backgroundColor="white" padding="25">
<Label text="Right Drawer" verticalAlignment="top" />
</GridLayout>
<GridLayout ~topDrawer class="drawer" height="65%" width="100%" backgroundColor="white" padding="25">
<Label text="Top Drawer" verticalAlignment="top" />
</GridLayout>
<GridLayout ~bottomDrawer class="drawer" height="65%" width="100%" backgroundColor="white" padding="25">
<Label text="Bottom Drawer" verticalAlignment="top" />
</GridLayout>
<StackLayout ~mainContent backgroundColor="white">
<Button @tap="onOpenDrawer('left')" text="Open Left Drawer" width="250" marginTop="25" />
<Button @tap="onOpenDrawer('right')" text="Open Right Drawer" width="250" marginTop="25" />
<Button @tap="onOpenDrawer('top')" text="Open Top Drawer" width="250" marginTop="25" />
<Button @tap="onOpenDrawer('bottom')" text="Open Bottom Drawer" width="250" marginTop="25" />
</StackLayout>
</Drawer>
</Page>
</template>
<script lang="ts">
import { $navigateBack } from "nativescript-vue"
export default {
setup() {
return {
$navigateBack
}
},
methods: {
// note: for some reason these methods don't work if called from a function registered in setup() or <script setup>
onOpenDrawer(side: string) {
this.$refs['drawer'].nativeView.open(side);
}
}
}
</script>
<style lang="scss" scoped>
</style>