代码:
生成一个页面
<!DOCTYPE html>
<html>
<head>
<meta charset = UTF-8/>
<title></title>
</head>
<body>
</body>
</html>
利用<script src="">
引入vue模块:
<script src="js/vue.js"></script>
实例化对象:
<!DOCTYPE html>
<html>
<head>
<meta charset = UTF-8/>
<title></title>
<script src="./lib/vue.js"></script>
</head>
<body>
<div class="app"></div>
<script>
var vm = new Vue({
el: '#app',
data: {}
})
</script>
</body>
</html>
methods方法:
methods:{
change(){