1.引入vue.js库
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
2. 创建vue实例
<script>
new Vue({
el:'#app',
data: {msg:"你好vue"}
})
</script>
3. html导入
<div id="app">
{ {message} }
</div>
4.完整的helloWorld代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="vue.js"></script>
<title>Hello Vue</title>
</head>
<body>
<h1>Hello Vue</h1>
<hr>
<div id="app">
{ {message} }
</div>
<script type="text/javascript">
var app=new Vue({
el:'#app',
data: {msg:"你好vue"}
})
</script>
</body>
</html>