08 2022 档案

摘要:事件处理: <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 编辑
摘要:为对象增加属性,也可以设置增加的属性的一些特性, <script> let person = { name:'张三', sex:'男' } Object.defineProperty(person,'age',{ value:18 }) console.log(person) </script> 设 阅读全文
posted @ 2022-08-18 16:34 bingxingc 编辑
摘要:第二种 绑定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 编辑
摘要: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 编辑
摘要:数据 绑定 案例1: <div id="app"> <h1> <a :href="url">{{name}}</a> </h1> </div> <script> new Vue({ el: '#app', data: { name: '百度', url: 'http://www.baidu.com' 阅读全文
posted @ 2022-08-17 23:40 bingxingc 编辑

点击右上角即可分享
微信分享提示