CDN(Vue3)
CDN 방식
이 문서 및 하위 문서에서는 VueJS를 별도의 도구 없이 HTML페이지에 직접 설정하고 코드를 작성하며 VueJS의 기본 구조를 살펴보는 내용으로 진행한다.
기본 템플릿
데모 페이지 구조는 다음과 같으며 사용한 VueJS 버전은 3.x이다.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome to Vue JS 3</title>
</head>
<body>
<div id="app">
<h1>{{text}}</h1>
</div>
<script src="https://unpkg.com/vue@next"></script>
<script>
const app = Vue.createApp({
data(){
return {
text : "Welcome to Vue JS 3!"
};
}
});
app.mount("#app");
</script>
</body>
</html>
실행 결과
codepen
github page
Last updated