forked from joshua1988/doit-vuejs
-
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.
Re-arranged the folder structure with the updated sample
- Loading branch information
1 parent
9c1408a
commit 5ec2050
Showing
218 changed files
with
13,456 additions
and
25,601 deletions.
There are no files selected for viewing
7 changes: 2 additions & 5 deletions
7
예제코드/03_뷰 시작하기/doit-vuejs/index.html → exam/02/02-1/index.html
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,23 +1,20 @@ | ||
<html> | ||
<head> | ||
<title>Hello Vue.js</title> | ||
<title>Vue Sample</title> | ||
</head> | ||
<body> | ||
<div id="app"> | ||
{{ message }} | ||
</div> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> | ||
<!-- <script src="vue.js"></script> --> | ||
<script> | ||
|
||
new Vue({ | ||
el: '#app', | ||
data: { | ||
message: 'Hello Vue.js!' | ||
} | ||
}) | ||
|
||
}); | ||
</script> | ||
</body> | ||
</html> |
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 @@ | ||
<html> | ||
<head> | ||
<title>Vue Instance Lifecycle</title> | ||
</head> | ||
<body> | ||
<div id="app"> | ||
{{ message }} | ||
</div> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> | ||
<script> | ||
new Vue({ | ||
el: '#app', | ||
data: { | ||
message: 'Hello Vue.js!' | ||
}, | ||
beforeCreate: function() { | ||
console.log("beforeCreate"); | ||
}, | ||
created: function() { | ||
console.log("created"); | ||
}, | ||
mounted: function() { | ||
console.log("mounted"); | ||
}, | ||
updated: function() { | ||
console.log("updated"); | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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
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,22 @@ | ||
<html> | ||
<head> | ||
<title>Vue Component Registration</title> | ||
</head> | ||
<body> | ||
<div id="app"> | ||
<button>컴포넌트 등록</button> | ||
<my-component></my-component> | ||
</div> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> | ||
<script> | ||
Vue.component('my-component', { | ||
template: '<div>전역 컴포넌트가 등록되었습니다!</div>' | ||
}); | ||
|
||
new Vue({ | ||
el: '#app' | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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,26 @@ | ||
<html> | ||
<head> | ||
<title>Vue Component Registration</title> | ||
</head> | ||
<body> | ||
<div id="app"> | ||
<button>컴포넌트 등록</button> | ||
<my-local-component></my-local-component> | ||
</div> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> | ||
<script> | ||
var cmp = { | ||
// 컴포넌트 내용 | ||
template: '<div>지역 컴포넌트가 등록되었습니다!</div>' | ||
}; | ||
|
||
new Vue({ | ||
el: '#app', | ||
components: { | ||
'my-local-component': cmp | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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,33 @@ | ||
<html> | ||
<head> | ||
<title>Vue Local and Global Components</title> | ||
</head> | ||
<body> | ||
<div id="app"> | ||
<h3>첫 번째 인스턴스 영역</h3> | ||
<my-global-component></my-global-component> | ||
<my-local-component></my-local-component> | ||
</div> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> | ||
<script> | ||
// 전역 컴포넌트 등록 | ||
Vue.component('my-global-component', { | ||
template: '<div>전역 컴포넌트 입니다.</div>' | ||
}); | ||
|
||
// 지역 컴포넌트 내용 | ||
var cmp = { | ||
template: '<div>지역 컴포넌트 입니다.</div>' | ||
}; | ||
|
||
new Vue({ | ||
el: '#app', | ||
// 지역 컴포넌트 등록 | ||
components: { | ||
'my-local-component': cmp | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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,25 +1,22 @@ | ||
|
||
<html> | ||
<head> | ||
<title>Vue Local and Global Components</title> | ||
</head> | ||
<body> | ||
|
||
<div id="app"> | ||
<h3>1번째 인스턴스 영역</h3> | ||
<h3>첫 번째 인스턴스 영역</h3> | ||
<my-global-component></my-global-component> | ||
<my-local-component></my-local-component> | ||
</div> | ||
<hr> | ||
<div id="app2"> | ||
<h3>2번째 인스턴스 영역</h3> | ||
<h3>두 번째 인스턴스 영역</h3> | ||
<my-global-component></my-global-component> | ||
<my-local-component></my-local-component> | ||
</div> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> | ||
<script> | ||
|
||
// 전역 컴포넌트 등록 | ||
Vue.component('my-global-component', { | ||
template: '<div>전역 컴포넌트 입니다.</div>' | ||
|
@@ -30,21 +27,18 @@ <h3>2번째 인스턴스 영역</h3> | |
template: '<div>지역 컴포넌트 입니다.</div>' | ||
}; | ||
|
||
// 1번째 인스턴스 | ||
new Vue({ | ||
el: '#app', | ||
// 지역 컴포넌트 등록 | ||
components: { | ||
'my-local-component': cmp | ||
} | ||
}) | ||
}); | ||
|
||
// 2번째 인스턴스 | ||
// 두 번째 인스턴스 | ||
new Vue({ | ||
el: '#app2' | ||
}) | ||
|
||
|
||
}); | ||
</script> | ||
</body> | ||
</html> |
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 |
---|---|---|
|
@@ -10,19 +10,19 @@ | |
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> | ||
<script> | ||
// 첫번째 컴포넌트 내용 | ||
// 첫 번째 컴포넌트 내용 | ||
var cmp1 = { | ||
template: '<div>1번째 지역 컴포넌트 : {{ cmp1Data }}</div>', | ||
template: '<div>첫 번째 지역 컴포넌트 : {{ cmp1Data }}</div>', | ||
data: function() { | ||
return { | ||
cmp1Data : 100 | ||
} | ||
} | ||
}; | ||
|
||
// 두번째 컴포넌트 내용 | ||
// 두 번째 컴포넌트 내용 | ||
var cmp2 = { | ||
template: '<div>2번째 지역 컴포넌트 : {{ cmp2Data }}</div>', | ||
template: '<div>두 번째 지역 컴포넌트 : {{ cmp2Data }}</div>', | ||
data: function() { | ||
return { | ||
cmp2Data : cmp1.data.cmp1Data | ||
|
@@ -37,7 +37,7 @@ | |
'my-component1': cmp1, | ||
'my-component2': cmp2 | ||
} | ||
}) | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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
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 |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
<title>Vue Router Sample</title> | ||
</head> | ||
<body> | ||
|
||
<div id="app"> | ||
<h1>뷰 라우터 예제</h1> | ||
<p> | ||
|
@@ -16,10 +15,9 @@ <h1>뷰 라우터 예제</h1> | |
<router-view></router-view> | ||
</div> | ||
|
||
<script src="https://unpkg.com/vue@2.4.4/dist/vue.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.2/dist/vue.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/vue-router.js"></script> | ||
<script> | ||
|
||
// 3. Main. Login 컴포넌트 내용 정의 | ||
var Main = { template: '<div>main</div>' }; | ||
var Login = { template: '<div>login</div>' }; | ||
|
@@ -37,9 +35,9 @@ <h1>뷰 라우터 예제</h1> | |
|
||
// 6. 뷰 라우터를 인스턴스에 등록 | ||
var app = new Vue({ | ||
router | ||
}).$mount('#app'); | ||
|
||
el: '#app', | ||
router: router | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.