-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
170 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,6 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
# Unplugin | ||
components.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
<!doctype html> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Tauri + Vue + TS</title> | ||
<title>Grassator</title> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
<style> | ||
html, | ||
body, | ||
#app { | ||
height: 100%; | ||
width: 100%; | ||
margin: unset; | ||
border: unset; | ||
padding: unset; | ||
} | ||
</style> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,7 @@ | |
</script> | ||
|
||
<template> | ||
<div class="container"> | ||
|
||
</div> | ||
<RouterView /> | ||
</template> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { | ||
createRouter, | ||
createWebHashHistory, | ||
type RouteRecordRaw, | ||
} from "vue-router"; | ||
|
||
const views = import.meta.glob([ | ||
"../views/**/*.vue", | ||
"../views/**/index.vue", | ||
"../views/**/\\[*\\].vue", | ||
]); | ||
|
||
const routes: RouteRecordRaw[] = Object.entries(views).map( | ||
([filePath, component]) => { | ||
let path = filePath | ||
.replace(/^\.\.\/views\//, "") | ||
.replace(/\.vue$/, "") | ||
.replace(/^(.*)\/?index$/, "$1") | ||
.replace(/\[(\w+)\]$/, ":$1"); | ||
path = "/" + path; | ||
|
||
return { | ||
path, | ||
name: filePath.replace(/^\.\.\/views\//, ""), | ||
component, | ||
} satisfies RouteRecordRaw; | ||
} | ||
); | ||
|
||
console.log(routes.length); | ||
|
||
const router = createRouter({ | ||
history: createWebHashHistory(import.meta.env.BASE_URL), | ||
routes: [...routes], | ||
}); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script setup lang="ts"> | ||
import { invoke } from '@tauri-apps/api/core'; | ||
import { onMounted } from 'vue'; | ||
onMounted(async () => { | ||
}) | ||
</script> | ||
|
||
<template> | ||
<main class="h-full w-full"> | ||
<div class="flex h-full w-full justify-center items-center"> | ||
<h1 class="text-4xl font-bold">Welcome to Grassator</h1> | ||
</div> | ||
</main> | ||
</template> | ||
|
||
<style scoped></style> |