Skip to content

Commit ca7c466

Browse files
committed
9장 예제 변경
1 parent a6f069d commit ca7c466

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3608
-358
lines changed
File renamed without changes.

ch07/test-vue-app/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# test-vue-app
2+
3+
This template should help get you started developing with Vue 3 in Vite.
4+
5+
## Recommended IDE Setup
6+
7+
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
8+
9+
## Customize configuration
10+
11+
See [Vite Configuration Reference](https://vitejs.dev/config/).
12+
13+
## Project Setup
14+
15+
```sh
16+
npm install
17+
```
18+
19+
### Compile and Hot-Reload for Development
20+
21+
```sh
22+
npm run dev
23+
```
24+
25+
### Compile and Minify for Production
26+
27+
```sh
28+
npm run build
29+
```
File renamed without changes.

ch07/test-vue-app/package.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "test-vue-app",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "vite",
7+
"build": "vite build",
8+
"preview": "vite preview"
9+
},
10+
"dependencies": {
11+
"vue": "^3.2.45"
12+
},
13+
"devDependencies": {
14+
"@vitejs/plugin-vue": "^4.0.3",
15+
"vite": "^4.0.3"
16+
}
17+
}

ch07/test-vue-app/src/App.vue

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<template>
2+
<div>
3+
<h2>관심있는 K-POP 가수?</h2><hr />
4+
<ul>
5+
<CheckboxItem v-for="idol in idols" :key="idol.id"
6+
:id="idol.id" :name="idol.name" :checked="idol.checked" />
7+
</ul>
8+
</div>
9+
</template>
10+
11+
<script>
12+
import CheckboxItem from './components/CheckboxItem.vue'
13+
export default {
14+
name: "App",
15+
components: { CheckboxItem },
16+
data() {
17+
return {
18+
idols : [
19+
{ id:1, name:"BTS", checked:true},
20+
{ id:2, name:"Black Pink" },
21+
{ id:3, name:"EXO" },
22+
{ id:4, name:"ITZY" },
23+
]
24+
}
25+
}
26+
}
27+
</script>

ch07/test-vue-app/src/App2.vue

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<template>
2+
<div>
3+
<h2>관심있는 K-POP 가수?</h2><hr />
4+
<ul>
5+
<CheckboxItem v-for="idol in idols" :key="idol.id" :idol="idol" />
6+
</ul>
7+
</div>
8+
</template>
9+
10+
<script>
11+
import CheckboxItem from './components/CheckboxItem2.vue'
12+
export default {
13+
name: "App2",
14+
components: { CheckboxItem },
15+
data() {
16+
return {
17+
idols : [
18+
{ id:1, name:"BTS", checked:true},
19+
{ id:2, name:"Black Pink", checked:false },
20+
{ id:3, name:"EXO", checked:false },
21+
{ id:4, name:"ITZY", checked:false },
22+
]
23+
}
24+
}
25+
}
26+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<template>
2+
<li>
3+
<input type="checkbox" :checked="checked" /> {{id}} - {{name}}
4+
</li>
5+
</template>
6+
7+
<script>
8+
export default {
9+
name: "CheckboxItem",
10+
props: {
11+
id: [Number, String],
12+
//name: String,
13+
name: {
14+
validator(v) {
15+
return typeof(v) !== "string" ?
16+
false :
17+
v.trim().length >= 4 ? true : false
18+
}
19+
},
20+
checked: {
21+
type: Boolean,
22+
required: false,
23+
default: false
24+
}
25+
},
26+
}
27+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<li>
3+
<input type="checkbox" :checked="idol.checked" /> {{idol.name}}
4+
</li>
5+
</template>
6+
7+
<script>
8+
export default {
9+
name : "CheckboxItem2",
10+
props : ["idol"],
11+
// created() {
12+
// this.idol.checked = true;
13+
// }
14+
}
15+
</script>

ch07/test-vue-app/src/main.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { createApp } from 'vue'
2+
import App from './App.vue'
3+
//import App from './App2.vue'
4+
//import App from './App3.vue'
5+
6+
import './assets/main.css'
7+
8+
createApp(App).mount('#app')
File renamed without changes.

ch08/style-test81/src/components/Child1.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ export default {
1010
}
1111
</script>
1212

13-
<style scoped>
13+
<style>
1414
.child { background-color: yellow; border:solid 1px black; margin:1.5em; padding: 1.0em; }
1515
</style>

ch08/v-model-test84/src/App.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<InputName v-model:name="searchName" />
3+
<InputName :value="name" @input="$emit('update:name', $event.target.value)" />
44
<h3> 검색어 : {{searchName}}</h3>
55
</div>
66
</template>

ch09/calc-component-test/src/App.vue

-22
This file was deleted.

ch09/calc-component-test/src/components/Calc.vue

-19
This file was deleted.

ch09/calc-component-test/src/components/Calc4.vue

-22
This file was deleted.

ch09/calc-component-test92/.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
.DS_Store
12+
dist
13+
dist-ssr
14+
coverage
15+
*.local
16+
17+
/cypress/videos/
18+
/cypress/screenshots/
19+
20+
# Editor directories and files
21+
.vscode/*
22+
!.vscode/extensions.json
23+
.idea
24+
*.suo
25+
*.ntvs*
26+
*.njsproj
27+
*.sln
28+
*.sw?
File renamed without changes.

ch09/calc-component-test92/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<link rel="icon" href="/favicon.ico">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Vite App</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.js"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)