개발중/Troubleshooting
Vue Js 기초 문법 에러
Binsoo
2021. 1. 18. 17:05
728x90
반응형
도저히 이해가 안되는 에러가 나왔다.
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
링크도 명시해 주었는데
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ page session="false" %>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script type="text/javascript">
var app = new Vue({
el: '#app',
data: {
message: '안녕하세요 Vue!'
}
})
</script>
<html>
<head>
<title>Home</title>
</head>
<body>
<div id="app">
{{ message }}
</div>
<P> The time on the server is ${serverTime}. </P>
</body>
</html>
이해가 정말 안간다.
오류를 인정하고 싶지 않지만
<script type="text/javascript">
window.onload = function () {
var app = new Vue({
el: '#app',
data: {
message: '안녕하세요 Vue!'
}
})
};
</script>
window.onload 로 열어주니까 된다.
728x90
반응형