前端学习(2359):如何注册事件
生活随笔
收集整理的這篇文章主要介紹了
前端学习(2359):如何注册事件
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<template><view><view>{{msg}}</view><view>{{'你好'+'世界'}}</view><image v-bind:src="imgUrl" mode=""></image><view v-for="(item,index) in arr">序號:{{index}}名字:{{item.name}},年齡:{{item.age}}</view><button type="primary" v-on:click="clickHandle(10,$event)">歌謠</button></view>
</template><script>export default {data() {return {msg:'hello',imgUrl:"../../static/2.jpg",arr:[{name:'宋小寶',age:20,id:1},{name:'宋小寶',age:20,id:1},{name:'歌謠',age:20,id:1}]}},methods: {clickHandle(num,e){console.log(num,e)}}}
</script><style></style>
運行結果
總結
以上是生活随笔為你收集整理的前端学习(2359):如何注册事件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 安卓输入法 车机版_触宝输入法HD
- 下一篇: 前端学习(2185):tabberite