@nativescript/template-drawer-navigation-vue 9.0.0 → 9.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App_Resources/iOS/Info.plist +2 -2
- package/app/app.css +21 -0
- package/app/app.js +6 -10
- package/app/components/App.vue +9 -24
- package/app/components/Browse.vue +13 -32
- package/app/components/DrawerContent.vue +48 -71
- package/app/components/Featured.vue +13 -32
- package/app/components/Home.vue +13 -32
- package/app/components/Search.vue +13 -32
- package/app/components/Settings.vue +13 -32
- package/app/shared/utils.js +6 -6
- package/package.json +6 -7
- package/app/_app-common.scss +0 -43
- package/app/app.android.scss +0 -4
- package/app/app.ios.scss +0 -4
- package/app/shared/selected-page-service.js +0 -24
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
<key>CFBundlePackageType</key>
|
|
16
16
|
<string>APPL</string>
|
|
17
17
|
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>1.0</string>
|
|
18
|
+
<string>1.0.0</string>
|
|
19
19
|
<key>CFBundleSignature</key>
|
|
20
20
|
<string>????</string>
|
|
21
21
|
<key>CFBundleVersion</key>
|
|
22
|
-
<string>1.0</string>
|
|
22
|
+
<string>1.0.0</string>
|
|
23
23
|
<key>LSRequiresIPhoneOS</key>
|
|
24
24
|
<true/>
|
|
25
25
|
<key>UILaunchStoryboardName</key>
|
package/app/app.css
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
ActionBar {
|
|
4
|
+
background-color: #65adf1;
|
|
5
|
+
color: white;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.fas {
|
|
9
|
+
font-family: 'Font Awesome 5 Free', 'fa-solid-900';
|
|
10
|
+
font-weight: 900;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.far {
|
|
14
|
+
font-family: 'Font Awesome 5 Free', 'fa-regular-400';
|
|
15
|
+
font-weight: 400;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.fab {
|
|
19
|
+
font-family: 'Font Awesome 5 Brands', 'fa-brands-400';
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
}
|
package/app/app.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { createApp } from 'nativescript-vue'
|
|
2
|
+
import DrawerPlugin from '@nativescript-community/ui-drawer/vue3'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import App from './components/App.vue'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
new Vue({
|
|
11
|
-
render: h => h(App)
|
|
12
|
-
}).$start()
|
|
6
|
+
const app = createApp(App)
|
|
7
|
+
app.use(DrawerPlugin)
|
|
8
|
+
app.start()
|
package/app/components/App.vue
CHANGED
|
@@ -1,37 +1,22 @@
|
|
|
1
|
-
<template
|
|
2
|
-
<
|
|
3
|
-
<StackLayout ~
|
|
4
|
-
<DrawerContent/>
|
|
1
|
+
<template>
|
|
2
|
+
<Drawer ref="drawer" gesturesEnabled="true">
|
|
3
|
+
<StackLayout ~leftDrawer backgroundColor="#ffffff">
|
|
4
|
+
<DrawerContent />
|
|
5
5
|
</StackLayout>
|
|
6
|
-
<Frame ~mainContent
|
|
7
|
-
<Home/>
|
|
6
|
+
<Frame ~mainContent>
|
|
7
|
+
<Home />
|
|
8
8
|
</Frame>
|
|
9
|
-
</
|
|
9
|
+
</Drawer>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script>
|
|
13
|
-
import DrawerContent from './DrawerContent'
|
|
14
|
-
import Home from './Home'
|
|
15
|
-
import { SlideInOnTopTransition } from 'nativescript-ui-sidedrawer';
|
|
13
|
+
import DrawerContent from './DrawerContent.vue'
|
|
14
|
+
import Home from './Home.vue'
|
|
16
15
|
|
|
17
16
|
export default {
|
|
18
|
-
data() {
|
|
19
|
-
return {
|
|
20
|
-
transition: new SlideInOnTopTransition()
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
|
|
24
17
|
components: {
|
|
25
18
|
DrawerContent,
|
|
26
19
|
Home
|
|
27
20
|
}
|
|
28
21
|
}
|
|
29
22
|
</script>
|
|
30
|
-
|
|
31
|
-
<style scoped lang="scss">
|
|
32
|
-
// Start custom common variables
|
|
33
|
-
@import '@nativescript/theme/scss/variables/blue';
|
|
34
|
-
// End custom common variables
|
|
35
|
-
|
|
36
|
-
// Custom styles
|
|
37
|
-
</style>
|
|
@@ -1,46 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Page
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<Page>
|
|
3
|
+
<ActionBar>
|
|
4
|
+
<GridLayout columns="auto, *">
|
|
5
|
+
<Label col="0" class="fas text-lg" text.decode="" @tap="onDrawerButtonTap"/>
|
|
6
|
+
<Label col="1" text="Browse" class="font-bold text-lg"/>
|
|
7
|
+
</GridLayout>
|
|
8
|
+
</ActionBar>
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<GridLayout class="page__content">
|
|
13
|
-
<Label class="page__content-icon far" text.decode=""/>
|
|
14
|
-
<Label class="page__content-placeholder" :text="message"/>
|
|
10
|
+
<GridLayout>
|
|
11
|
+
<Label class="far text-7xl text-gray-400 text-center" style="vertical-align: top; margin-top: 20%" text.decode=""/>
|
|
12
|
+
<Label class="text-xl text-gray-400 text-center align-middle" text="Page content goes here"/>
|
|
15
13
|
</GridLayout>
|
|
16
14
|
</Page>
|
|
17
15
|
</template>
|
|
18
16
|
|
|
19
17
|
<script>
|
|
20
|
-
import * as utils from
|
|
21
|
-
import { SelectedPageService } from "../shared/selected-page-service";
|
|
18
|
+
import * as utils from '~/shared/utils'
|
|
22
19
|
|
|
23
20
|
export default {
|
|
24
|
-
mounted() {
|
|
25
|
-
SelectedPageService.getInstance().updateSelectedPage("Browse");
|
|
26
|
-
},
|
|
27
|
-
computed: {
|
|
28
|
-
message() {
|
|
29
|
-
return "<!-- Page content goes here -->";
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
21
|
methods: {
|
|
33
22
|
onDrawerButtonTap() {
|
|
34
|
-
utils.showDrawer()
|
|
23
|
+
utils.showDrawer()
|
|
35
24
|
}
|
|
36
25
|
}
|
|
37
|
-
}
|
|
26
|
+
}
|
|
38
27
|
</script>
|
|
39
|
-
|
|
40
|
-
<style scoped lang="scss">
|
|
41
|
-
// Start custom common variables
|
|
42
|
-
@import '@nativescript/theme/scss/variables/blue';
|
|
43
|
-
// End custom common variables
|
|
44
|
-
|
|
45
|
-
// Custom styles
|
|
46
|
-
</style>
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
<template
|
|
2
|
-
<GridLayout rows="auto, *"
|
|
3
|
-
<StackLayout row="0" class="
|
|
4
|
-
<Image class="
|
|
5
|
-
<Label class="
|
|
6
|
-
<Label class="
|
|
1
|
+
<template>
|
|
2
|
+
<GridLayout rows="auto, *">
|
|
3
|
+
<StackLayout row="0" class="p-4 bg-gray-100">
|
|
4
|
+
<Image class="fas text-4xl text-gray-500 text-center" src.decode="font://"/>
|
|
5
|
+
<Label class="text-lg font-bold text-center" text="User Name"/>
|
|
6
|
+
<Label class="text-sm text-gray-500 text-center" text="username@mail.com"/>
|
|
7
7
|
</StackLayout>
|
|
8
8
|
|
|
9
|
-
<ScrollView row="1"
|
|
9
|
+
<ScrollView row="1">
|
|
10
10
|
<StackLayout>
|
|
11
|
-
<GridLayout columns="auto, *"
|
|
12
|
-
:class="'
|
|
13
|
-
@tap="onNavigationItemTap(Home)">
|
|
14
|
-
<Label col="0" text.decode="" class="
|
|
15
|
-
<Label col="1" text="Home" class="
|
|
11
|
+
<GridLayout columns="auto, *" class="p-4"
|
|
12
|
+
:class="{ 'bg-gray-200': selectedPage === 'Home' }"
|
|
13
|
+
@tap="onNavigationItemTap(Home, 'Home')">
|
|
14
|
+
<Label col="0" text.decode="" class="fas text-lg w-8"/>
|
|
15
|
+
<Label col="1" text="Home" class="text-base"/>
|
|
16
16
|
</GridLayout>
|
|
17
17
|
|
|
18
|
-
<GridLayout columns="auto, *"
|
|
19
|
-
:class="'
|
|
20
|
-
@tap="onNavigationItemTap(Browse)">
|
|
21
|
-
<Label col="0" text.decode="" class="
|
|
22
|
-
<Label col="1" text="Browse" class="
|
|
18
|
+
<GridLayout columns="auto, *" class="p-4"
|
|
19
|
+
:class="{ 'bg-gray-200': selectedPage === 'Browse' }"
|
|
20
|
+
@tap="onNavigationItemTap(Browse, 'Browse')">
|
|
21
|
+
<Label col="0" text.decode="" class="far text-lg w-8"/>
|
|
22
|
+
<Label col="1" text="Browse" class="text-base"/>
|
|
23
23
|
</GridLayout>
|
|
24
24
|
|
|
25
|
-
<GridLayout columns="auto, *"
|
|
26
|
-
:class="'
|
|
27
|
-
@tap="onNavigationItemTap(Search)">
|
|
28
|
-
<Label col="0" text.decode="" class="
|
|
29
|
-
<Label col="1" text="Search" class="
|
|
25
|
+
<GridLayout columns="auto, *" class="p-4"
|
|
26
|
+
:class="{ 'bg-gray-200': selectedPage === 'Search' }"
|
|
27
|
+
@tap="onNavigationItemTap(Search, 'Search')">
|
|
28
|
+
<Label col="0" text.decode="" class="fas text-lg w-8"/>
|
|
29
|
+
<Label col="1" text="Search" class="text-base"/>
|
|
30
30
|
</GridLayout>
|
|
31
31
|
|
|
32
|
-
<GridLayout columns="auto, *"
|
|
33
|
-
:class="'
|
|
34
|
-
@tap="onNavigationItemTap(Featured)">
|
|
35
|
-
<Label col="0" text.decode="" class="
|
|
36
|
-
<Label col="1" text="Featured" class="
|
|
32
|
+
<GridLayout columns="auto, *" class="p-4"
|
|
33
|
+
:class="{ 'bg-gray-200': selectedPage === 'Featured' }"
|
|
34
|
+
@tap="onNavigationItemTap(Featured, 'Featured')">
|
|
35
|
+
<Label col="0" text.decode="" class="fas text-lg w-8"/>
|
|
36
|
+
<Label col="1" text="Featured" class="text-base"/>
|
|
37
37
|
</GridLayout>
|
|
38
38
|
|
|
39
|
-
<StackLayout class="
|
|
39
|
+
<StackLayout class="border-b border-gray-300 my-2"/>
|
|
40
40
|
|
|
41
|
-
<GridLayout columns="auto, *"
|
|
42
|
-
:class="'
|
|
43
|
-
@tap="onNavigationItemTap(Settings)">
|
|
44
|
-
<Label col="0" text.decode="" class="
|
|
45
|
-
<Label col="1" text="Settings" class="
|
|
41
|
+
<GridLayout columns="auto, *" class="p-4"
|
|
42
|
+
:class="{ 'bg-gray-200': selectedPage === 'Settings' }"
|
|
43
|
+
@tap="onNavigationItemTap(Settings, 'Settings')">
|
|
44
|
+
<Label col="0" text.decode="" class="fas text-lg w-8"/>
|
|
45
|
+
<Label col="1" text="Settings" class="text-base"/>
|
|
46
46
|
</GridLayout>
|
|
47
47
|
</StackLayout>
|
|
48
48
|
</ScrollView>
|
|
@@ -50,51 +50,28 @@
|
|
|
50
50
|
</template>
|
|
51
51
|
|
|
52
52
|
<script>
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
import
|
|
53
|
+
import { $navigateTo } from 'nativescript-vue'
|
|
54
|
+
import * as utils from '~/shared/utils'
|
|
55
|
+
import Home from './Home.vue'
|
|
56
|
+
import Browse from './Browse.vue'
|
|
57
|
+
import Featured from './Featured.vue'
|
|
58
|
+
import Search from './Search.vue'
|
|
59
|
+
import Settings from './Settings.vue'
|
|
60
60
|
|
|
61
61
|
export default {
|
|
62
|
-
mounted() {
|
|
63
|
-
SelectedPageService.getInstance().selectedPage$
|
|
64
|
-
.subscribe((selectedPage) => this.selectedPage = selectedPage);
|
|
65
|
-
},
|
|
66
62
|
data() {
|
|
67
63
|
return {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
Featured: Featured,
|
|
71
|
-
Search: Search,
|
|
72
|
-
Settings: Settings,
|
|
73
|
-
selectedPage: ""
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
components: {
|
|
77
|
-
Home,
|
|
78
|
-
Browse,
|
|
79
|
-
Featured,
|
|
80
|
-
Search,
|
|
81
|
-
Settings
|
|
64
|
+
selectedPage: 'Home'
|
|
65
|
+
}
|
|
82
66
|
},
|
|
83
67
|
methods: {
|
|
84
|
-
onNavigationItemTap(component) {
|
|
85
|
-
this
|
|
68
|
+
onNavigationItemTap(component, pageName) {
|
|
69
|
+
this.selectedPage = pageName
|
|
70
|
+
$navigateTo(component, {
|
|
86
71
|
clearHistory: true
|
|
87
|
-
})
|
|
88
|
-
utils.closeDrawer()
|
|
72
|
+
})
|
|
73
|
+
utils.closeDrawer()
|
|
89
74
|
}
|
|
90
75
|
}
|
|
91
|
-
}
|
|
76
|
+
}
|
|
92
77
|
</script>
|
|
93
|
-
|
|
94
|
-
<style scoped lang="scss">
|
|
95
|
-
// Start custom common variables
|
|
96
|
-
@import '@nativescript/theme/scss/variables/blue';
|
|
97
|
-
// End custom common variables
|
|
98
|
-
|
|
99
|
-
// Custom styles
|
|
100
|
-
</style>
|
|
@@ -1,46 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Page
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<Page>
|
|
3
|
+
<ActionBar>
|
|
4
|
+
<GridLayout columns="auto, *">
|
|
5
|
+
<Label col="0" class="fas text-lg" text.decode="" @tap="onDrawerButtonTap"/>
|
|
6
|
+
<Label col="1" text="Featured" class="font-bold text-lg"/>
|
|
7
|
+
</GridLayout>
|
|
8
|
+
</ActionBar>
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<GridLayout class="page__content">
|
|
13
|
-
<Label class="page__content-icon fas" text.decode=""/>
|
|
14
|
-
<Label class="page__content-placeholder" :text="message"/>
|
|
10
|
+
<GridLayout>
|
|
11
|
+
<Label class="fas text-7xl text-gray-400 text-center" style="vertical-align: top; margin-top: 20%" text.decode=""/>
|
|
12
|
+
<Label class="text-xl text-gray-400 text-center align-middle" text="Page content goes here"/>
|
|
15
13
|
</GridLayout>
|
|
16
14
|
</Page>
|
|
17
15
|
</template>
|
|
18
16
|
|
|
19
17
|
<script>
|
|
20
|
-
import * as utils from
|
|
21
|
-
import { SelectedPageService } from "../shared/selected-page-service";
|
|
18
|
+
import * as utils from '~/shared/utils'
|
|
22
19
|
|
|
23
20
|
export default {
|
|
24
|
-
mounted() {
|
|
25
|
-
SelectedPageService.getInstance().updateSelectedPage("Featured");
|
|
26
|
-
},
|
|
27
|
-
computed: {
|
|
28
|
-
message() {
|
|
29
|
-
return "<!-- Page content goes here -->";
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
21
|
methods: {
|
|
33
22
|
onDrawerButtonTap() {
|
|
34
|
-
utils.showDrawer()
|
|
23
|
+
utils.showDrawer()
|
|
35
24
|
}
|
|
36
25
|
}
|
|
37
|
-
}
|
|
26
|
+
}
|
|
38
27
|
</script>
|
|
39
|
-
|
|
40
|
-
<style scoped lang="scss">
|
|
41
|
-
// Start custom common variables
|
|
42
|
-
@import '@nativescript/theme/scss/variables/blue';
|
|
43
|
-
// End custom common variables
|
|
44
|
-
|
|
45
|
-
// Custom styles
|
|
46
|
-
</style>
|
package/app/components/Home.vue
CHANGED
|
@@ -1,46 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Page
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<Page>
|
|
3
|
+
<ActionBar>
|
|
4
|
+
<GridLayout columns="auto, *">
|
|
5
|
+
<Label col="0" class="fas text-lg" text.decode="" @tap="onDrawerButtonTap"/>
|
|
6
|
+
<Label col="1" text="Home" class="font-bold text-lg"/>
|
|
7
|
+
</GridLayout>
|
|
8
|
+
</ActionBar>
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<GridLayout class="page__content">
|
|
13
|
-
<Label class="page__content-icon fas" text.decode=""/>
|
|
14
|
-
<Label class="page__content-placeholder" :text="message"/>
|
|
10
|
+
<GridLayout>
|
|
11
|
+
<Label class="fas text-7xl text-gray-400 text-center" style="vertical-align: top; margin-top: 20%" text.decode=""/>
|
|
12
|
+
<Label class="text-xl text-gray-400 text-center align-middle" text="Page content goes here"/>
|
|
15
13
|
</GridLayout>
|
|
16
14
|
</Page>
|
|
17
15
|
</template>
|
|
18
16
|
|
|
19
17
|
<script>
|
|
20
|
-
import * as utils from
|
|
21
|
-
import { SelectedPageService } from "../shared/selected-page-service";
|
|
18
|
+
import * as utils from '~/shared/utils'
|
|
22
19
|
|
|
23
20
|
export default {
|
|
24
|
-
mounted() {
|
|
25
|
-
SelectedPageService.getInstance().updateSelectedPage("Home");
|
|
26
|
-
},
|
|
27
|
-
computed: {
|
|
28
|
-
message() {
|
|
29
|
-
return "<!-- Page content goes here -->";
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
21
|
methods: {
|
|
33
22
|
onDrawerButtonTap() {
|
|
34
|
-
utils.showDrawer()
|
|
23
|
+
utils.showDrawer()
|
|
35
24
|
}
|
|
36
25
|
}
|
|
37
|
-
}
|
|
26
|
+
}
|
|
38
27
|
</script>
|
|
39
|
-
|
|
40
|
-
<style scoped lang="scss">
|
|
41
|
-
// Start custom common variables
|
|
42
|
-
@import '@nativescript/theme/scss/variables/blue';
|
|
43
|
-
// End custom common variables
|
|
44
|
-
|
|
45
|
-
// Custom styles
|
|
46
|
-
</style>
|
|
@@ -1,46 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Page
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<Page>
|
|
3
|
+
<ActionBar>
|
|
4
|
+
<GridLayout columns="auto, *">
|
|
5
|
+
<Label col="0" class="fas text-lg" text.decode="" @tap="onDrawerButtonTap"/>
|
|
6
|
+
<Label col="1" text="Search" class="font-bold text-lg"/>
|
|
7
|
+
</GridLayout>
|
|
8
|
+
</ActionBar>
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<GridLayout class="page__content">
|
|
13
|
-
<Label class="page__content-icon fas" text.decode=""/>
|
|
14
|
-
<Label class="page__content-placeholder" :text="message"/>
|
|
10
|
+
<GridLayout>
|
|
11
|
+
<Label class="fas text-7xl text-gray-400 text-center" style="vertical-align: top; margin-top: 20%" text.decode=""/>
|
|
12
|
+
<Label class="text-xl text-gray-400 text-center align-middle" text="Page content goes here"/>
|
|
15
13
|
</GridLayout>
|
|
16
14
|
</Page>
|
|
17
15
|
</template>
|
|
18
16
|
|
|
19
17
|
<script>
|
|
20
|
-
import * as utils from
|
|
21
|
-
import { SelectedPageService } from "../shared/selected-page-service";
|
|
18
|
+
import * as utils from '~/shared/utils'
|
|
22
19
|
|
|
23
20
|
export default {
|
|
24
|
-
mounted() {
|
|
25
|
-
SelectedPageService.getInstance().updateSelectedPage("Search");
|
|
26
|
-
},
|
|
27
|
-
computed: {
|
|
28
|
-
message() {
|
|
29
|
-
return "<!-- Page content goes here -->";
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
21
|
methods: {
|
|
33
22
|
onDrawerButtonTap() {
|
|
34
|
-
utils.showDrawer()
|
|
23
|
+
utils.showDrawer()
|
|
35
24
|
}
|
|
36
25
|
}
|
|
37
|
-
}
|
|
26
|
+
}
|
|
38
27
|
</script>
|
|
39
|
-
|
|
40
|
-
<style scoped lang="scss">
|
|
41
|
-
// Start custom common variables
|
|
42
|
-
@import '@nativescript/theme/scss/variables/blue';
|
|
43
|
-
// End custom common variables
|
|
44
|
-
|
|
45
|
-
// Custom styles
|
|
46
|
-
</style>
|
|
@@ -1,46 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Page
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<Page>
|
|
3
|
+
<ActionBar>
|
|
4
|
+
<GridLayout columns="auto, *">
|
|
5
|
+
<Label col="0" class="fas text-lg" text.decode="" @tap="onDrawerButtonTap"/>
|
|
6
|
+
<Label col="1" text="Settings" class="font-bold text-lg"/>
|
|
7
|
+
</GridLayout>
|
|
8
|
+
</ActionBar>
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<GridLayout class="page__content">
|
|
13
|
-
<Label class="page__content-icon fas" text.decode=""/>
|
|
14
|
-
<Label class="page__content-placeholder" :text="message"/>
|
|
10
|
+
<GridLayout>
|
|
11
|
+
<Label class="fas text-7xl text-gray-400 text-center" style="vertical-align: top; margin-top: 20%" text.decode=""/>
|
|
12
|
+
<Label class="text-xl text-gray-400 text-center align-middle" text="Page content goes here"/>
|
|
15
13
|
</GridLayout>
|
|
16
14
|
</Page>
|
|
17
15
|
</template>
|
|
18
16
|
|
|
19
17
|
<script>
|
|
20
|
-
import * as utils from
|
|
21
|
-
import { SelectedPageService } from "../shared/selected-page-service";
|
|
18
|
+
import * as utils from '~/shared/utils'
|
|
22
19
|
|
|
23
20
|
export default {
|
|
24
|
-
mounted() {
|
|
25
|
-
SelectedPageService.getInstance().updateSelectedPage("Settings");
|
|
26
|
-
},
|
|
27
|
-
computed: {
|
|
28
|
-
message() {
|
|
29
|
-
return "<!-- Page content goes here -->";
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
21
|
methods: {
|
|
33
22
|
onDrawerButtonTap() {
|
|
34
|
-
utils.showDrawer()
|
|
23
|
+
utils.showDrawer()
|
|
35
24
|
}
|
|
36
25
|
}
|
|
37
|
-
}
|
|
26
|
+
}
|
|
38
27
|
</script>
|
|
39
|
-
|
|
40
|
-
<style scoped lang="scss">
|
|
41
|
-
// Start custom common variables
|
|
42
|
-
@import '@nativescript/theme/scss/variables/blue';
|
|
43
|
-
// End custom common variables
|
|
44
|
-
|
|
45
|
-
// Custom styles
|
|
46
|
-
</style>
|
package/app/shared/utils.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Application } from '@nativescript/core'
|
|
2
2
|
|
|
3
3
|
export const showDrawer = () => {
|
|
4
|
-
|
|
5
|
-
if (
|
|
6
|
-
|
|
4
|
+
const root = Application.getRootView()
|
|
5
|
+
if (root && root.open) {
|
|
6
|
+
root.open()
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export const closeDrawer = () => {
|
|
11
|
-
|
|
12
|
-
if (
|
|
13
|
-
|
|
11
|
+
const root = Application.getRootView()
|
|
12
|
+
if (root && root.close) {
|
|
13
|
+
root.close()
|
|
14
14
|
}
|
|
15
15
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"main": "app/app.js",
|
|
4
4
|
"displayName": "Navigation Drawer",
|
|
5
5
|
"templateType": "App template",
|
|
6
|
-
"version": "9.0.
|
|
6
|
+
"version": "9.0.2",
|
|
7
7
|
"description": "Side navigation template using Vue.",
|
|
8
8
|
"author": "NativeScript Team <oss@nativescript.org>",
|
|
9
9
|
"license": "Apache-2.0",
|
|
@@ -42,13 +42,12 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@nativescript/core": "~9.0.0",
|
|
45
|
-
"@nativescript/
|
|
46
|
-
"nativescript-
|
|
47
|
-
"nativescript-vue": "~2.9.3",
|
|
48
|
-
"rxjs": "~7.8.0"
|
|
45
|
+
"@nativescript-community/ui-drawer": "^1.0.0",
|
|
46
|
+
"nativescript-vue": "^3.0.0"
|
|
49
47
|
},
|
|
50
48
|
"devDependencies": {
|
|
51
|
-
"@nativescript/
|
|
52
|
-
"nativescript
|
|
49
|
+
"@nativescript/tailwind": "^4.0.0",
|
|
50
|
+
"@nativescript/webpack": "~5.0.31",
|
|
51
|
+
"tailwindcss": "^4.0.0"
|
|
53
52
|
}
|
|
54
53
|
}
|
package/app/_app-common.scss
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
@import '@nativescript/theme/core';
|
|
2
|
-
@import '@nativescript/theme/default';
|
|
3
|
-
|
|
4
|
-
// Place any CSS rules you want to apply on both iOS and Android here.
|
|
5
|
-
// This is where the vast majority of your CSS code goes.
|
|
6
|
-
|
|
7
|
-
// Font icon class
|
|
8
|
-
.fab {
|
|
9
|
-
font-family: 'Font Awesome 5 Brands', 'fa-brands-400';
|
|
10
|
-
font-weight: 400;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.fas {
|
|
14
|
-
font-family: 'Font Awesome 5 Free', 'fa-solid-900';
|
|
15
|
-
font-weight: 900;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.far {
|
|
19
|
-
font-family: 'Font Awesome 5 Free', 'fa-regular-400';
|
|
20
|
-
font-weight: 400;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Common page class
|
|
24
|
-
.page__content {
|
|
25
|
-
&-icon,
|
|
26
|
-
&-placeholder {
|
|
27
|
-
color: const(grey);
|
|
28
|
-
font-size: 20;
|
|
29
|
-
vertical-align: center;
|
|
30
|
-
horizontal-align: center;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&-icon {
|
|
34
|
-
font-size: 72;
|
|
35
|
-
vertical-align: top;
|
|
36
|
-
margin-top: 20%;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Drawer navigation custom styles
|
|
41
|
-
.nt-drawer__header-image {
|
|
42
|
-
color: const(grey);
|
|
43
|
-
}
|
package/app/app.android.scss
DELETED
package/app/app.ios.scss
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { BehaviorSubject } from 'rxjs'
|
|
2
|
-
|
|
3
|
-
export function SelectedPageService() {
|
|
4
|
-
if (SelectedPageService._instance) {
|
|
5
|
-
throw new Error('Use SelectedPageService.getInstance() instead of new.')
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// Observable selectedPage source
|
|
9
|
-
this._selectedPageSource = new BehaviorSubject('')
|
|
10
|
-
|
|
11
|
-
// Observable selectedPage stream
|
|
12
|
-
this.selectedPage$ = this._selectedPageSource.asObservable()
|
|
13
|
-
|
|
14
|
-
this.updateSelectedPage = function (selectedPage) {
|
|
15
|
-
this._selectedPageSource.next(selectedPage)
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
SelectedPageService.getInstance = function () {
|
|
20
|
-
return SelectedPageService._instance
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
SelectedPageService._instance = new SelectedPageService()
|
|
24
|
-
|