add bottom navigation bar

This commit is contained in:
SRP-mango 2023-07-15 16:34:46 +07:00
parent 0e54335e9d
commit 4051138da8
11 changed files with 136 additions and 24 deletions

View file

@ -4,8 +4,10 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="https://cdn.jsdelivr.net/npm/@mdi/font@5.x/css/materialdesignicons.min.css" rel="stylesheet">
<title>micromobility-navigation</title> <title>micromobility-navigation</title>
<style> <style>
html, body {margin: 0; height: 100%; overflow: hidden} html, body {margin: 0; height: 100%; overflow: hidden}
</style> </style>

View file

@ -9,7 +9,8 @@
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"vue": "^3.3.4", "vue": "^3.3.4",
"vue-router": "^4.2.4" "vue-router": "^4.2.4",
"vuetify": "^3.3.8"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue": "^4.2.3",
@ -729,6 +730,39 @@
"peerDependencies": { "peerDependencies": {
"vue": "^3.2.0" "vue": "^3.2.0"
} }
},
"node_modules/vuetify": {
"version": "3.3.8",
"resolved": "https://registry.npmjs.org/vuetify/-/vuetify-3.3.8.tgz",
"integrity": "sha512-m88MUczIeyNXfINnklBhat2fRknOUmeWyxgGTOZI5b95j9JTZwPH0b1z979nS6gJIyhPDVTuZSS/abp5aUyGBA==",
"engines": {
"node": "^12.20 || >=14.13"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/johnleider"
},
"peerDependencies": {
"typescript": ">=4.7",
"vite-plugin-vuetify": "^1.0.0-alpha.12",
"vue": "^3.2.0",
"vue-i18n": "^9.0.0",
"webpack-plugin-vuetify": "^2.0.0-alpha.11"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
},
"vite-plugin-vuetify": {
"optional": true
},
"vue-i18n": {
"optional": true
},
"webpack-plugin-vuetify": {
"optional": true
}
}
} }
} }
} }

View file

@ -10,7 +10,8 @@
}, },
"dependencies": { "dependencies": {
"vue": "^3.3.4", "vue": "^3.3.4",
"vue-router": "^4.2.4" "vue-router": "^4.2.4",
"vuetify": "^3.3.8"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue": "^4.2.3",

View file

@ -1,15 +1,12 @@
<template> <template>
<router-view/>
<ul> <bottomNavigation/>
<li><router-link :to="{name: 'home'}">Home</router-link></li>
<!-- <li><router-link :to="{name: 'about'}">About</router-link></li> --> <router-view/>
<li><router-link :to="{name: 'setting'}">Setting</router-link></li>
</ul>
</template> </template>
<script setup> <script setup>
import {RouterLink, RouterView} from 'vue-router'; import {RouterView} from 'vue-router';
import bottomNavigation from '@/components/bottom-navigation.vue';
</script> </script>

View file

@ -0,0 +1,41 @@
<template>
<v-layout class="overflow-visible" style="height: 56px;">
<v-bottom-navigation
v-model="value"
color="teal"
grow
>
<router-link :to="{name: 'home'}">
<v-btn :to="{name: 'home'}">
<v-icon>mdi-map</v-icon>
แผนท
</v-btn>
</router-link>
<router-link :to="{name: 'favorite'}">
<v-btn :to="{name: 'favorite'}">
<v-icon>mdi-heart</v-icon>
สถานทโปรด
</v-btn>
</router-link>
<router-link :to="{name: 'setting'}">
<v-btn :to="{name: 'setting'}">
<v-icon>mdi-cog</v-icon>
การตงค
</v-btn>
</router-link>
</v-bottom-navigation>
</v-layout>
</template>
<script>
import {RouterLink} from 'vue-router';
export default {
data: () => ({ value: 1 }),
}
</script>

View file

@ -1,7 +1,18 @@
import { createApp } from 'vue' import { createApp } from 'vue'
import '@/style.css' import '@/style.css'
// Vuetify
import 'vuetify/styles'
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'
import App from '@/App.vue' import App from '@/App.vue'
import router from '@/plugins/router' import router from '@/plugins/router'
createApp(App).use(router).mount('#app') const vuetify = createVuetify({
components,
directives,
})
createApp(App).use(router).use(vuetify).mount('#app')

View file

@ -3,6 +3,7 @@ import {createRouter, createWebHistory} from 'vue-router'
const routes = [ const routes = [
{path: '', name: 'home', component: () => import('@/views/Home.vue')}, {path: '', name: 'home', component: () => import('@/views/Home.vue')},
{path: '/about', name: 'about', component: () => import('@/views/About.vue')}, {path: '/about', name: 'about', component: () => import('@/views/About.vue')},
{path: '/favorite', name: 'favorite', component: () => import('@/views/Favorite.vue')},
{path: '/setting', name: 'setting', component: () => import('@/views/Setting.vue')}, {path: '/setting', name: 'setting', component: () => import('@/views/Setting.vue')},
] ]
const router = createRouter({ const router = createRouter({

View file

@ -0,0 +1,27 @@
import { createApp } from 'vue'
import { createVuetify, ThemeDefinition } from 'vuetify'
const myCustomLightTheme = {
dark: false,
colors: {
background: '#FFFFFF',
surface: '#FFFFFF',
primary: '#6200EE',
'primary-darken-1': '#3700B3',
secondary: '#03DAC6',
'secondary-darken-1': '#018786',
error: '#B00020',
info: '#2196F3',
success: '#4CAF50',
warning: '#FB8C00',
},
}
export default createVuetify({
theme: {
defaultTheme: 'myCustomLightTheme',
themes: {
myCustomLightTheme,
},
},
})

View file

@ -2,9 +2,8 @@
body{ body{
display: block; display: block;
margin: auto auto auto auto; margin: auto auto auto auto;
padding: 1rem 1rem 1rem 1rem;
max-width: 450px; max-width: 450px;
height: 925px; max-height: auto;
background-color: white; background-color: white;
} }
:root{ :root{

View file

@ -0,0 +1,9 @@
<template>
<h1>Favorie</h1>
<ul>
<li>List of Destination</li>
<li>List of Destination</li>
<li>List of Destination</li>
<li>List of Destination</li>
</ul>
</template>

View file

@ -1,15 +1,5 @@
<template> <template>
<img src="https://cdn.discordapp.com/attachments/933187220217663570/1129696534863286353/image.png.png" alt="placeholder for map">
<h1>Home</h1>
<div>
Search System Here
</div>
<div>
Map
</div>
</template> </template>
<script setup> <script setup>