-
Notifications
You must be signed in to change notification settings - Fork 3
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
9 changed files
with
84 additions
and
33 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 |
---|---|---|
@@ -1 +1,5 @@ | ||
# vue-ssr-extra | ||
|
||
## credits | ||
|
||
- https://github.com/frandiox/vite-ssr |
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
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,24 @@ | ||
import type { RouteRecordRaw } from "vue-router"; | ||
|
||
export const routes: RouteRecordRaw[] = [ | ||
{ | ||
path: "/", | ||
component: () => import("./routes/page.vue"), | ||
name: "home", | ||
}, | ||
{ | ||
path: "/client", | ||
component: () => import("./routes/client/page.vue"), | ||
name: "client", | ||
}, | ||
{ | ||
path: "/server", | ||
component: () => import("./routes/server/page.vue"), | ||
name: "server", | ||
}, | ||
{ | ||
path: "/:catchAll(.*)", | ||
component: () => import("./routes/not-found.vue"), | ||
name: "not-found", | ||
}, | ||
]; |
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,17 @@ | ||
<script setup lang="ts"> | ||
import { ref, onMounted } from "vue"; | ||
const count = ref(0); | ||
const hydrated = ref(false); | ||
onMounted(() => { | ||
hydrated.value = true; | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div>hydrated: {{ hydrated }}</div> | ||
<div>Count: {{ count }}</div> | ||
<button type="button" @click="count--">-1</button> | ||
<button type="button" @click="count++">+1</button> | ||
</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 @@ | ||
<template> | ||
<h3>Vue example</h3> | ||
<nav> | ||
<ul> | ||
<li> | ||
<RouterLink to="/">Home</RouterLink> | ||
</li> | ||
<li> | ||
<RouterLink to="/client">Counter (client)</RouterLink> | ||
</li> | ||
<li> | ||
<RouterLink to="/server">Counter (server)</RouterLink> | ||
</li> | ||
</ul> | ||
</nav> | ||
<main> | ||
<RouterView /> | ||
</main> | ||
</template> |
2 changes: 1 addition & 1 deletion
2
examples/vue-ssr-extra/src/root.vue → ...es/vue-ssr-extra/src/routes/not-found.vue
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,3 +1,3 @@ | ||
<template> | ||
<RouterView /> | ||
<div>Not Found</div> | ||
</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 |
---|---|---|
@@ -1,19 +1,3 @@ | ||
<script setup lang="ts"> | ||
import { ref, onMounted } from "vue"; | ||
const count = ref(0); | ||
const hydrated = ref(false); | ||
onMounted(() => { | ||
hydrated.value = true; | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<div>hydrated: {{ hydrated }}</div> | ||
<div>Count: {{ count }}</div> | ||
<button type="button" @click="count--">-1</button> | ||
<button type="button" @click="count++">+1</button> | ||
</div> | ||
<div>Home Page</div> | ||
</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,3 @@ | ||
<template> | ||
<div>TODO: Server Counter</div> | ||
</template> |