<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="app">
<div @click="divClick">wwww<button @click.stop="btnClick">按钮</button></div>
<form action="baidu">
<input type="submit" value="tijiao" @click.prevent="subMit">
</form>
<input type="text" @keyup.enter="keyUp">
</div>
<script src="./vue.js"></script>
<script>
const app = new Vue({
el: '#app',
data : {
counter : 0
},
methods: {
btnClick(){
console.log('ss')
},
divClick(){
console.log('divdiv')
},
subMit(){
console.log('ddd')
},
keyUp(){
console.log('up')
}
}
})
</script>
</body>
</html>
菜鸟教程