뷰 강의를 듣는데, 강의와 똑같은 코드임에도 불구하고 웹에 message 가 출력되지 않았다.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="https:/unpkg.com/vue"></script>
<script>
window.onload = function() {
var test1View = new Vue({
el : '#test1',
data : {
message : '첫 번째 Vue.js 애플리케이션'
}
})
}
</script>
</head>
<body>
<div id="test1">
<h1>{{ message }}</h1>
</div>
</body>
</html>
도대체 왜일까...왜 안나올까.. 계속 찾아보았는데..
<script src="https:/unpkg.com/vue"></script>
가 문제였다. 해당 url에 들어가보면 뷰3이 디폴트값이었다..
나의 코드는 뷰2라 당연히 안 먹음
그래서 스크립트를 강제로 뷰2로 설정했다.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.0"></script>
<script>
window.onload = function() {
var test1View = new Vue({
el : '#test1',
data : {
message : '첫 번째 Vue.js 애플리케이션'
}
})
}
</script>
</head>
<body>
<div id="test1">
<h1>{{ message }}</h1>
</div>
</body>
</html>
그랬더니 잘 나옴..
vue는 구글링해도 한국어 자료가 정말 없고
최근에 보니까 한국어 공식 문서도 없어졌다;;;;;;;;;;;;;;;;;
아자아자 화이팅
728x90
'ETC > Vue.js' 카테고리의 다른 글
beforeCreate / created Vue 생성주기 (0) | 2022.12.19 |
---|---|
Vue 시작은 객체 생성부터, function () { [native code] } 오류 (0) | 2022.12.18 |
Vue js 공부시작 (0) | 2022.12.18 |
Vue 기본 출력 (0) | 2022.12.09 |
Vue 샘플 코드 참고용 (0) | 2022.12.08 |
댓글