Skip to content

Commit b94e27d

Browse files
committed
refactor: migrate nuxt 4 app folder
1 parent 97ebfc4 commit b94e27d

31 files changed

+698
-1174
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"editor.codeActionsOnSave": {
66
"source.fixAll.eslint": "explicit",
77
"source.organizeImports": "never"
8-
}
8+
},
9+
"typescript.tsdk": "node_modules/typescript/lib"
910
}

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:20-alpine as build-stage
2+
3+
WORKDIR /app
4+
RUN corepack enable
5+
6+
COPY .npmrc package.json pnpm-lock.yaml ./
7+
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
8+
pnpm install --frozen-lockfile
9+
10+
COPY . .
11+
RUN pnpm build
12+
13+
# SSR
14+
FROM node:20-alpine as production-stage
15+
16+
WORKDIR /app
17+
18+
COPY --from=build-stage /app/.output ./.output
19+
20+
EXPOSE 3000
21+
22+
CMD ["node", ".output/server/index.mjs"]

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
# Element Plus with Nuxt 3 Minimal Starter
22

3-
<pre align="center">
4-
🏗 Working in Progress
5-
</pre>
6-
7-
SSR Preview: <https://element-plus-nuxt.vercel.app/>
8-
9-
SSG Preview: <https://nuxt-starter.element-plus.org/>
3+
- SSR Preview: <https://element-plus-nuxt.vercel.app/>
4+
- SSG Preview: <https://nuxt-starter.element-plus.org/>
105

116
We recommend to look at the [Nuxt 3 Docs](https://nuxt.com/) and [Element Plus Docs](https://element-plus.org/).
127

8+
> If you are looking for a Vite + Vue + Element Plus starter, check out [element-plus-vite-starter](https://github.com/element-plus/element-plus-vite-starter/).
9+
1310
## Setup
1411

1512
Make sure to install the dependencies

app.vue

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/app.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<script setup lang="ts">
2+
import { appName } from '~/constants'
3+
4+
useHead({
5+
title: appName,
6+
})
7+
</script>
8+
<template>
9+
<NuxtLayout>
10+
<NuxtPage />
11+
</NuxtLayout>
12+
</template>
File renamed without changes.
File renamed without changes.
File renamed without changes.

app/components/DarkToggle.vue

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<script setup lang="ts">
2+
const color = useColorMode()
3+
4+
useHead({
5+
meta: [{
6+
id: 'theme-color',
7+
name: 'theme-color',
8+
content: () => color.value === 'dark' ? '#222222' : '#ffffff',
9+
}],
10+
})
11+
12+
function toggleDark() {
13+
color.preference = color.value === 'dark' ? 'light' : 'dark'
14+
}
15+
</script>
16+
17+
<template>
18+
<button class="inline-flex justify-center items-center" @click="toggleDark">
19+
<div class="i-ri-sun-line dark:i-ri-moon-line" />
20+
</button>
21+
</template>

app/components/GitHubLink.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script setup lang="ts">
2+
import { repository } from "~/../package.json";
3+
</script>
4+
5+
<template>
6+
<a class="inline-flex justify-center items-center dark:text-white" :href="repository.url" target="_blank">
7+
<div i-ri-github-line />
8+
</a>
9+
</template>

0 commit comments

Comments
 (0)