在这里插入代码片<!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 class="app">
<p @click = "ch">{{msg}}</p>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.9/vue.js"></script>
<script>
var vm = new Vue({
el : ".app",
data : {
msg : "点击我"
},
methods: {
ch (){
this.msg = "hello" + this.show();
},
show(){
return "world";
}
}
})
</script>
</body>
</html>
Vue事件绑定指令
最新推荐文章于 2024-04-19 18:32:11 发布