首页 > 其他分享 >vue.js代码030

vue.js代码030

时间:2023-02-25 12:05:25浏览次数:49  
标签:vue background color tip js padding Vue 5px 030


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>事件绑定</title>
<script type="text/javascript" src="../js/vue.js"></script>
<style>
.box1{
padding: 5px;
background-color: skyblue;
}

.box2{
padding: 5px;
background-color: orange;
}
</style>
</head>
<body>
<div id="root">
<h2>{{name}}</h2>
<div class="box1" @click="showMsg($event,1)">
box1
<div class="box2" @click="showMsg($event,2)">
box2
</div>
</div>


</div>
<script type="text/javascript">
Vue.config.productionTip = false;

const vm = new Vue({
el:'#root',
data:{
name:'虾米大王'
},
methods:{
showMsg(event,tip){
console.log(tip); //正常,冒泡事件时处理顺序
}
}
})


</script>
</body>
</html>

标签:vue,background,color,tip,js,padding,Vue,5px,030
From: https://blog.51cto.com/u_15356972/6085187

相关文章

  • vus.js代码029
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>事件绑定</title><scripttype="text/javascript"src="../js/vue.js"></script></head>......
  • vue.js代码028
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>事件绑定</title><scripttype="text/javascript"src="../js/vue.js"></script></head>......
  • vus.js代码027
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>事件绑定</title><scripttype="text/javascript"src="../js/vue.js"></script></head>......
  • vue.js代码026
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>事件绑定</title><scripttype="text/javascript"src="../js/vue.js"></script></head>......
  • vue.js代码022
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>事件绑定</title><scripttype="text/javascript"src="../js/vue.js"></script></head>......
  • vue.js代码021
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>事件绑定</title><scripttype="text/javascript"src="../js/vue.js"></script></head>......
  • vue.js代码025
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>事件绑定</title><scripttype="text/javascript"src="../js/vue.js"></script></head>......
  • vue.js代码024
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>事件绑定</title><scripttype="text/javascript"src="../js/vue.js"></script></head>......
  • vue.js代码023
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>事件绑定</title><scripttype="text/javascript"src="../js/vue.js"></script></head>......
  • vue.js代码019
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>Title</title><scripttype="text/javascript"src="../js/vue.js"></script></head><......