-
Notifications
You must be signed in to change notification settings - Fork 66
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
24 changed files
with
2,004 additions
and
1,020 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
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,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Vite App</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"dev": "nodemon --watch ../../dist/index.js -x \"cross-env DEBUG=vite-plugin-layouts vite\"", | ||
"build": "cross-env DEBUG=vite-plugin-layouts vite build", | ||
"serve": "vite preview" | ||
}, | ||
"dependencies": { | ||
"vue": "^3.2.31", | ||
"vue-router": "4.0.3" | ||
}, | ||
"devDependencies": { | ||
"@vitejs/plugin-vue": "^1.10.2", | ||
"@vue/compiler-sfc": "^3.2.31", | ||
"cross-env": "^7.0.3", | ||
"nodemon": "^2.0.15", | ||
"typescript": "^4.6.2", | ||
"vite": "^2.8.6", | ||
"vite-plugin-md": "^0.6.7", | ||
"vite-plugin-pages": "0.12.1", | ||
"vite-plugin-vue-layouts": "workspace:*" | ||
} | ||
} |
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,3 @@ | ||
<template> | ||
<router-view /> | ||
</template> |
Empty file.
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,8 @@ | ||
<template> | ||
<main class="px-4 py-10 text-center text-gray-700 dark:text-gray-200"> | ||
<div class="w-1/4 m-auto text-center text-gray-300 bg-teal-800"> | ||
Default Layout | ||
</div> | ||
<router-view /> | ||
</main> | ||
</template> |
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,8 @@ | ||
<template> | ||
<main class="px-4 py-10 text-center text-gray-700 dark:text-gray-200"> | ||
<div class="w-1/4 m-auto text-center text-gray-300 bg-teal-800"> | ||
Second Layout | ||
</div> | ||
<router-view /> | ||
</main> | ||
</template> |
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,8 @@ | ||
<template> | ||
<main class="px-4 py-10 text-center text-gray-700 dark:text-gray-200"> | ||
<div class="w-1/4 m-auto text-center text-gray-300 bg-teal-800"> | ||
Layout Sub Folder | ||
</div> | ||
<router-view /> | ||
</main> | ||
</template> |
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,19 @@ | ||
import { createApp } from 'vue' | ||
import { createRouter, createWebHistory } from 'vue-router' | ||
import { setupLayouts } from 'virtual:generated-layouts' | ||
import generatedRoutes from 'virtual:generated-pages' | ||
import App from './App.vue' | ||
import './index.css' | ||
|
||
const routes = setupLayouts(generatedRoutes) | ||
|
||
const router = createRouter({ | ||
history: createWebHistory(), | ||
routes, | ||
}) | ||
|
||
const app = createApp(App) | ||
|
||
app.use(router) | ||
|
||
app.mount('#app') |
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,6 @@ | ||
<template> | ||
<p>/about/index.vue</p> | ||
<router-link to="/about/who/me"> | ||
me | ||
</router-link> | ||
</template> |
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,12 @@ | ||
<template> | ||
<p>meeeeee</p> | ||
</template> | ||
|
||
<route> | ||
{ | ||
name: "who-me-override", | ||
meta: { | ||
requiresAuth: false | ||
} | ||
} | ||
</route> |
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,33 @@ | ||
<template> | ||
<div> | ||
<p>index.vue</p> | ||
<router-link to="/about"> | ||
about | ||
</router-link> | ||
<p> | ||
<router-link to="/news"> | ||
news | ||
</router-link> | | ||
<router-link :to="{ name: 'named-news-page' }"> | ||
today's news | ||
</router-link> | ||
</p> | ||
<p> | ||
<router-link to="/sublayout"> | ||
sub layout | ||
</router-link> | ||
</p> | ||
<p> | ||
<router-link to="/nolayout"> | ||
no layout | ||
</router-link> | ||
</p> | ||
</div> | ||
</template> | ||
|
||
<route> | ||
{ | ||
name: "name-override", | ||
meta: {requiresAuth: false} | ||
} | ||
</route> |
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,11 @@ | ||
<template> | ||
<router-view /> | ||
</template> | ||
|
||
<route> | ||
{ | ||
meta: { | ||
layout: "second" | ||
} | ||
} | ||
</route> |
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,8 @@ | ||
<template> | ||
<p>/news/today.vue</p> | ||
</template> | ||
<route> | ||
{ | ||
name: 'named-news-page' | ||
} | ||
</route> |
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,3 @@ | ||
<template> | ||
<p>/news/index.vue</p> | ||
</template> |
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,10 @@ | ||
<template> | ||
<div> | ||
<p>nolayout</p> | ||
</div> | ||
</template> | ||
|
||
<route lang="yaml"> | ||
meta: | ||
layout: false | ||
</route> |
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,12 @@ | ||
<template> | ||
<div> | ||
<p>sublayout</p> | ||
</div> | ||
</template> | ||
|
||
<route> | ||
{meta: { | ||
layout: "sub/layoutsub" | ||
} | ||
} | ||
</route> |
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,5 @@ | ||
declare module '*.vue' { | ||
import type { DefineComponent } from 'vue' | ||
const component: DefineComponent<{}, {}, any> | ||
export default component | ||
} |
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,21 @@ | ||
import { defineConfig } from 'vite' | ||
import Vue from '@vitejs/plugin-vue' | ||
import Pages from 'vite-plugin-pages' | ||
import Markdown from 'vite-plugin-md' | ||
import { ClientSideLayout } from 'vite-plugin-vue-layouts' | ||
|
||
const config = defineConfig({ | ||
plugins: [ | ||
Vue({ | ||
include: [/\.vue$/, /\.md$/], | ||
}), | ||
Pages({ | ||
extensions: ['vue', 'md'], | ||
syncIndex: false, | ||
}), | ||
ClientSideLayout(), | ||
Markdown(), | ||
], | ||
}) | ||
|
||
export default config |
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
Oops, something went wrong.