feat: layout

This commit is contained in:
aaa
2025-02-03 10:47:19 +08:00
parent 965b7dbf83
commit 4a63f8454d
15 changed files with 9676 additions and 0 deletions

15
.editorconfig Normal file
View File

@@ -0,0 +1,15 @@
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
[*.{vue,js,ts,json,md,html}]
charset = utf-8
indent_style = space
indent_size = 2
[Makefile]
indent_style = tab

7
app.vue Normal file
View File

@@ -0,0 +1,7 @@
<template>
<NuxtLayout>
<v-app>
<NuxtPage />
</v-app>
</NuxtLayout>
</template>

View File

@@ -0,0 +1,17 @@
<template>
<v-navigation-drawer expand-on-hover rail>
<v-list>
<v-list-item prepend-avatar="https://randomuser.me/api/portraits/women/85.jpg"
subtitle="sandra_a88@gmailcom" title="Sandra Adams"></v-list-item>
</v-list>
<v-divider></v-divider>
<v-list density="compact" nav>
<v-list-item prepend-icon="mdi-folder" title="My Files" value="myfiles"></v-list-item>
<v-list-item prepend-icon="mdi-account-multiple" title="Shared with me" value="shared"></v-list-item>
<v-list-item prepend-icon="mdi-star" title="Starred" value="starred"></v-list-item>
</v-list>
</v-navigation-drawer>
</template>

10
layouts/desktop.vue Normal file
View File

@@ -0,0 +1,10 @@
<template>
<v-layout class="rounded rounded-md">
<!-- <p>desktop layout</p> -->
<DesktopSideBar />
<v-app-bar><slot name="app-bar-container"></slot></v-app-bar>
<v-main class="d-flex align-center justify-center" style="min-height: 300px;">
<slot />
</v-main>
</v-layout>
</template>

25
nuxt.config.ts Normal file
View File

@@ -0,0 +1,25 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
export default defineNuxtConfig({
build: {
transpile: ['vuetify'],
},
modules: [
(_options, nuxt) => {
nuxt.hooks.hook('vite:extendConfig', (config) => {
// @ts-expect-error
config.plugins.push(vuetify({ autoImport: true }))
})
},
//...
],
vite: {
vue: {
template: {
transformAssetUrls,
},
},
},
compatibilityDate: '2024-11-01',
devtools: { enabled: true }
})

9526
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

22
package.json Normal file
View File

@@ -0,0 +1,22 @@
{
"name": "nuxt-app",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"@mdi/font": "^7.4.47",
"nuxt": "^3.15.4",
"vue": "latest",
"vue-router": "latest"
},
"devDependencies": {
"vite-plugin-vuetify": "^2.0.4",
"vuetify": "^3.7.9"
}
}

View File

@@ -0,0 +1,10 @@
<template>
<div>
Dashboard Page
</div>
</template>
<script setup lang="ts">
definePageMeta({
layout: 'desktop'
})
</script>

View File

@@ -0,0 +1,15 @@
<template>
<div>
<NuxtLayout name="desktop">
<template #app-bar-container>
<v-app-bar-title>Transactions</v-app-bar-title>
</template>
Transaction Page
</NuxtLayout>
</div>
</template>
<script setup lang="ts">
definePageMeta({
})
</script>

9
pages/index.vue Normal file
View File

@@ -0,0 +1,9 @@
<template>
<div>Index</div>
</template>
<script setup lang="ts">
definePageMeta({
layout: 'desktop'
})
</script>

12
plugins/vuetify.ts Normal file
View File

@@ -0,0 +1,12 @@
// import this after install `@mdi/font` package
import '@mdi/font/css/materialdesignicons.css'
import 'vuetify/styles'
import { createVuetify } from 'vuetify'
export default defineNuxtPlugin((app) => {
const vuetify = createVuetify({
// ... your configuration
})
app.vueApp.use(vuetify)
})

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

1
public/robots.txt Normal file
View File

@@ -0,0 +1 @@

3
server/tsconfig.json Normal file
View File

@@ -0,0 +1,3 @@
{
"extends": "../.nuxt/tsconfig.server.json"
}

4
tsconfig.json Normal file
View File

@@ -0,0 +1,4 @@
{
// https://nuxt.com/docs/guide/concepts/typescript
"extends": "./.nuxt/tsconfig.json"
}