-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
3ce5201
commit 0574ad0
Showing
16 changed files
with
430 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,3 @@ | ||
//랜더링은 주로 뷰(View)를 사용자에게 표시하는 과정을 일반적으로 설명할 때 사용되며, 마운트는 Vue 인스턴스를 생성하고 실제 DOM에 연결하여 화면에 나타내는 초기 과정을 설명할 때 사용됩니다. | ||
|
||
//컴포넌트란 |
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,26 +1,31 @@ | ||
<template> | ||
<img alt="Vue logo" src="./assets/logo.png"> | ||
<HelloWorld msg="Welcome to Your Vue.js App"/> | ||
<nav> | ||
<router-link to="/">Home</router-link> | | ||
<router-link to="/about">About</router-link> | | ||
<router-link to="/binding"> 데이터 바인딩</router-link> | ||
</nav> | ||
<router-view/> | ||
</template> | ||
|
||
<script> | ||
import HelloWorld from './components/HelloWorld.vue' | ||
export default { | ||
name: 'App', | ||
components: { | ||
HelloWorld | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
#app { | ||
font-family: Avenir, Helvetica, Arial, sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
text-align: center; | ||
color: #2c3e50; | ||
margin-top: 60px; | ||
} | ||
nav { | ||
padding: 30px; | ||
} | ||
nav a { | ||
font-weight: bold; | ||
color: #2c3e50; | ||
} | ||
nav a.router-link-exact-active { | ||
color: #42b983; | ||
} | ||
</style> |
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,4 +1,5 @@ | ||
import { createApp } from 'vue' | ||
import App from './App.vue' | ||
import router from './router' | ||
|
||
createApp(App).mount('#app') | ||
createApp(App).use(router).mount('#app') |
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,31 @@ | ||
import { createRouter, createWebHistory } from 'vue-router' | ||
import HomeView from '../views/HomeView.vue' | ||
import DataBinding from '../views/ComputedVue.vue' | ||
|
||
const routes = [ | ||
{ | ||
path: '/', | ||
name: 'home', | ||
component: HomeView | ||
}, | ||
{ | ||
path:'/binding', | ||
name:'binding', | ||
component: DataBinding | ||
}, | ||
{ | ||
path: '/about', | ||
name: 'about', | ||
// route level code-splitting | ||
// this generates a separate chunk (about.[hash].js) for this route | ||
// which is lazy-loaded when the route is visited. | ||
component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue') | ||
} | ||
] | ||
|
||
const router = createRouter({ | ||
history: createWebHistory(process.env.BASE_URL), | ||
routes | ||
}) | ||
|
||
export default router |
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,5 @@ | ||
<template> | ||
<div class="about"> | ||
<h1>This is an about page</h1> | ||
</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,28 @@ | ||
<template> | ||
<div> | ||
<h1>{{ `${this.lastName} ${this.firstName}` }}</h1> | ||
<h1>{{ `${fullName}` }}</h1> | ||
</div> | ||
<input type="text" v-model="lastName"> | ||
<input type="text" v-model="firstName"> | ||
</template> | ||
<script> | ||
export default { | ||
data() { | ||
return { | ||
firstName: 'kildong', | ||
lastName: 'Hong' | ||
} | ||
}, | ||
computed: { | ||
fullName() { | ||
return `${this.lastName} ${this.firstName}` | ||
} | ||
}, | ||
watch: { //변경이전, 이후. | ||
firstName(curr,bef){ | ||
console.log(curr,bef); | ||
} | ||
} | ||
} | ||
</script> |
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,21 @@ | ||
<template> | ||
<h3>Hello,{{msg}}</h3>> | ||
<div>{{htmlStr}}</div> | ||
<div v-html="htmlStr"></div> | ||
<input type="text" v-model="vmodel"/> | ||
<p>{{vmodel}}</p> | ||
<textarea cols="30" rows="10" v-model="message"></textarea> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data(){ | ||
return{ | ||
msg:'World', | ||
htmlStr: '<p style="color: red;">Hello</p>', | ||
vmodel:'Nice', | ||
message:'여러라인의 값을 입력하ㅔㅅ요,' | ||
} | ||
} | ||
} | ||
</script> |
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,32 @@ | ||
<template> | ||
<select v-model="city"> | ||
<option value="02">서울</option> | ||
<option value="03">부산</option> | ||
<option value="04">제주</option> | ||
</select> | ||
<p>{{ city }}</p> | ||
<label>선택: <input type="checkbox" true-value="yes" false-value="no" v-model="checked"></label> | ||
<p>선택값:{{ checked }}</p> | ||
|
||
<!-- v-model 속성 체크되면 value값 반환?? --> | ||
<label><input type="checkbox" v-model="checkItems" value="01">서울</label> | ||
<label><input type="checkbox" v-model="checkItems" value="02">부산</label> | ||
<label><input type="checkbox" v-model="checkItems" value="03">제주</label> | ||
<label><input type="checkbox" v-model="checkItems" value="04">대전</label> | ||
<p>선택값: {{ orderItems }}</p> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
city: "04", | ||
checked: "yes", | ||
// 배열로 선언 => value 값 담을 수 있음 | ||
// 배열 없이 변수로 선언시 T/F 만 가능 | ||
checkItems: ["01"] | ||
} | ||
} | ||
} | ||
</script> |
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,28 @@ | ||
<template> | ||
<label>선택: <input type="checkbox" true-value="yes" false-value="no" v-model="checked"></label> | ||
<p>선택값: {{ checked }}</p> | ||
|
||
<label>text속성: <input type="text" v-bind:value="ival"></label> | ||
<p>값: {{ ival }}</p> | ||
|
||
<!-- v-bind: attribute의 값을 바인딩 --> | ||
<img v-bind:src="imgSrc" v-bind:width="imgWidth"> | ||
<input type="text" v-model="textStr"> | ||
<button v-bind:disabled="textStr == ''">Click</button> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
checked: "yes", | ||
ival: "sample", | ||
checkVal: true, | ||
imgSrc: 'https://kr.vuejs.org/images/logo.png', | ||
imgWidth: "100px", | ||
isTrue: true, | ||
textStr: '' | ||
} | ||
} | ||
} | ||
</script> |
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,59 @@ | ||
<template> | ||
<div class="container" v-bind:class="simpleClass"> | ||
Hello | ||
</div> | ||
<div class="container" v-bind:class="{ active: activeValue, 'text-red': redValue }"> | ||
Hello | ||
</div> | ||
<div class="container" v-bind:class="{ active: activeClass, 'text-red': redClass }"> | ||
Hello | ||
</div> | ||
<div style="color: red; background: yellow;">sty1</div> | ||
<div v-bind:style="{ color: att1, background: att2 }"> | ||
sty2 | ||
</div> | ||
<div v-bind:style="colorStyle">sty3</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
simpleClass: 'active text-red', | ||
activeValue: true, | ||
redValue: false, | ||
activeClass: 'active', | ||
redClass: 'text-red', | ||
att1: 'red', | ||
att2: 'yellow', | ||
//colorStyle: 'color: red; background: yellow;' | ||
colorStyle :{ | ||
color:'red', | ||
background:'yellow' | ||
} | ||
}; | ||
}, | ||
//mount는 data 영역 끝나고 선언 해야 함. | ||
mount(){ | ||
console.log(this); | ||
}, | ||
method:{ | ||
//이벤트 실행함수 | ||
} | ||
}; | ||
</script> | ||
|
||
<style> | ||
.container{ | ||
width : 100%; | ||
height : 50px; | ||
} | ||
.active{ | ||
background-color: yellow; | ||
font-weight: bold; | ||
} | ||
.text-red{ | ||
color:red; | ||
} | ||
</style> |
Oops, something went wrong.