<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="app">
<a v-bind:href="url">百度</a>
<button v-on:click='handle'>切换</button>
</div>
<script type="text/javascript" src="./js/vue.js"></script>
<script>
/* 语法功能 */
//自定义按键修饰符 名字自定义 对应的值必须是event的值
var vm = new Vue({
//绑定的标签
el: '#app',
//自定义按键修饰符
data: {
url: 'http://www.baidu.com'
},
methods: {
handle: function() {
this.url = 'www.geyao'
}
}
});
</script>
</body>
</html>