Nuxt 로 변경 및 추가
This commit is contained in:
24
nuxt/.gitignore
vendored
Normal file
24
nuxt/.gitignore
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# Nuxt dev/build outputs
|
||||
.output
|
||||
.data
|
||||
.nuxt
|
||||
.nitro
|
||||
.cache
|
||||
dist
|
||||
|
||||
# Node dependencies
|
||||
node_modules
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
.fleet
|
||||
.idea
|
||||
|
||||
# Local env files
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
75
nuxt/README.md
Normal file
75
nuxt/README.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# Nuxt Minimal Starter
|
||||
|
||||
Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
|
||||
|
||||
## Setup
|
||||
|
||||
Make sure to install dependencies:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm install
|
||||
|
||||
# pnpm
|
||||
pnpm install
|
||||
|
||||
# yarn
|
||||
yarn install
|
||||
|
||||
# bun
|
||||
bun install
|
||||
```
|
||||
|
||||
## Development Server
|
||||
|
||||
Start the development server on `http://localhost:3000`:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm run dev
|
||||
|
||||
# pnpm
|
||||
pnpm dev
|
||||
|
||||
# yarn
|
||||
yarn dev
|
||||
|
||||
# bun
|
||||
bun run dev
|
||||
```
|
||||
|
||||
## Production
|
||||
|
||||
Build the application for production:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm run build
|
||||
|
||||
# pnpm
|
||||
pnpm build
|
||||
|
||||
# yarn
|
||||
yarn build
|
||||
|
||||
# bun
|
||||
bun run build
|
||||
```
|
||||
|
||||
Locally preview production build:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm run preview
|
||||
|
||||
# pnpm
|
||||
pnpm preview
|
||||
|
||||
# yarn
|
||||
yarn preview
|
||||
|
||||
# bun
|
||||
bun run preview
|
||||
```
|
||||
|
||||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
|
||||
53
nuxt/app.vue
Normal file
53
nuxt/app.vue
Normal file
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<h1>사용자 목록</h1>
|
||||
<!-- 데이터가 로드되면 목록을 출력하고, 로드되지 않았으면 로딩 메시지를 표시 -->
|
||||
<ul v-if="users.length">
|
||||
<li v-for="user in users" :key="user.id">
|
||||
{{ user.name }} - {{ user.phone }}
|
||||
</li>
|
||||
</ul>
|
||||
<p v-else>Loading...</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {ref, onMounted} from 'vue';
|
||||
import axios from 'axios'; // axios 불러오기
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
setup() {
|
||||
const users = ref([]); // 사용자 목록을 저장할 ref 변수
|
||||
|
||||
const fetchUsers = async () => {
|
||||
try {
|
||||
const response = await axios.get('/api/all'); // 엔드포인트를 적절히 변경
|
||||
users.value = response.data; // 데이터를 users 배열에 저장
|
||||
} catch (error) {
|
||||
console.error('데이터를 가져오는 중 오류가 발생했습니다:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 컴포넌트가 마운트될 때 fetchUsers 함수를 호출하여 데이터 가져오기
|
||||
onMounted(() => {
|
||||
fetchUsers();
|
||||
});
|
||||
|
||||
return {
|
||||
users,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#app {
|
||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: left;
|
||||
color: #2c3e50;
|
||||
margin-top: 60px;
|
||||
}
|
||||
</style>
|
||||
8
nuxt/nuxt.config.ts
Normal file
8
nuxt/nuxt.config.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
compatibilityDate: '2024-04-03',
|
||||
devtools: { enabled: true },
|
||||
plugins: [
|
||||
'~/plugins/ant-design-vue.js'
|
||||
]
|
||||
})
|
||||
20
nuxt/package.json
Normal file
20
nuxt/package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "nuxt-app",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "nuxt build",
|
||||
"dev": "nuxt dev",
|
||||
"generate": "nuxt generate",
|
||||
"preview": "nuxt preview",
|
||||
"postinstall": "nuxt prepare"
|
||||
},
|
||||
"dependencies": {
|
||||
"ant-design-vue": "^4.2.5",
|
||||
"axios": "^1.7.7",
|
||||
"nuxt": "^3.13.2",
|
||||
"vue": "latest",
|
||||
"vue-router": "latest"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||
}
|
||||
5
nuxt/plugins/ant-design-vue.js
Normal file
5
nuxt/plugins/ant-design-vue.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue';
|
||||
import Antd from 'ant-design-vue';
|
||||
import 'ant-design-vue/dist/antd.css';
|
||||
|
||||
Vue.use(Antd);
|
||||
BIN
nuxt/public/favicon.ico
Normal file
BIN
nuxt/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
1
nuxt/public/robots.txt
Normal file
1
nuxt/public/robots.txt
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
3
nuxt/server/tsconfig.json
Normal file
3
nuxt/server/tsconfig.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "../.nuxt/tsconfig.server.json"
|
||||
}
|
||||
4
nuxt/tsconfig.json
Normal file
4
nuxt/tsconfig.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
// https://nuxt.com/docs/guide/concepts/typescript
|
||||
"extends": "./.nuxt/tsconfig.json"
|
||||
}
|
||||
5473
nuxt/yarn.lock
Normal file
5473
nuxt/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user