This commit is contained in:
2023-05-04 15:23:59 +08:00
parent 6ebd6e0ed1
commit de9695af0e
12 changed files with 32 additions and 51 deletions

9
packages/2-nuxtConfig/.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
node_modules
*.log*
.nuxt
.nitro
.cache
.output
.env
dist
.DS_Store

View File

@@ -0,0 +1 @@
shamefully-hoist=true

View File

@@ -0,0 +1,3 @@
# Nuxt Config

View File

@@ -0,0 +1,11 @@
<template>
<div>
{{ config }}
</div>
</template>
<script lang="ts" setup>
let config = useRuntimeConfig();
onMounted(() => {
console.log(config);
});
</script>

View File

@@ -0,0 +1,9 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
runtimeConfig: {
public: {
token: "123",
footer: "copyright2023"
},
},
})

View File

@@ -0,0 +1,15 @@
{
"name": "nuxt-app",
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"devDependencies": {
"@types/node": "^18",
"nuxt": "^3.4.3"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

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