目录
- index.html
- vue.js
引入vue.js
<script src="./vue.js"></script>
全文
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Vue入门</title>
<script src="./vue.js"></script>
</head>
<body>
hello world
</body>
</html>
建Vue实例
new Vue({
el:"#root",
data:{
msg:"hello world"
}
});
全文
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Vue入门</title>
<script src="./vue.js"></script>
</head>
<body>
<div id="root">
{{msg}}
</div>
</body>
<script>
new Vue({
el:"#root",
data:{
msg:"hello world"
}
});
</script>
</html>
v-text