摘要: 事件处理: <div id="app"> <h1>点击事件实例</h1> <button v-on:click="showInfo1">点我出提示</button> <button @click="showInfo2(111,$event)">点我出提示</button> </div> <scrip 阅读全文
posted @ 2022-08-18 17:13 bingxingc 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 为对象增加属性,也可以设置增加的属性的一些特性, <script> let person = { name:'张三', sex:'男' } Object.defineProperty(person,'age',{ value:18 }) console.log(person) </script> 设 阅读全文
posted @ 2022-08-18 16:34 bingxingc 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 第二种 绑定div元素的写法 <div id="app"> <h1>hello {{name}}</h1> </div> <script> const v = new Vue({ //el:'#app' data:{ name:'chen', } }) v.$mount('#app') </scri 阅读全文
posted @ 2022-08-18 15:30 bingxingc 阅读(39) 评论(0) 推荐(0) 编辑
摘要: vue数据双向绑定 <div id="app"> 单向数据绑定:<input type="text" v-bind:value="txt"> <br> <br> 双向数据绑定:<input type="text" v-model:value="txt"> </div> <script> new Vu 阅读全文
posted @ 2022-08-18 00:32 bingxingc 阅读(19) 评论(0) 推荐(0) 编辑