<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<!-- -->
<title></title>
</head>
<body>
<div id='app'>
{{ msg }}
<input type="text" v-model="msg">
</div>
</body>
<script type="text/javascript">
window.onload = function() {
var vm = new Vue({
el : "#app", //vue和容器的關聯關系,用于,開發者自定義變量的的範圍
data : {
msg:'msg bian liang'
}
});
console.log('vm');
}
</script>
</html>
1、安裝node.js
2、安裝vue 腳手架工具
npm install --global vue-cli