<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<!-- 1. 第一步引用vue库 -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<!-- 2. 定义ID -->
<div id="app">
{{ message }}
</div>
<!-- 3. 实例化Vue()函数,并初始化参数 -->
<script type = 'text/javascript'>
var app = new Vue({
el: '#app',
data: {
message: 'hello world!'
}
})
</script>
</body>
</html>