随笔分类 -  vue

摘要:1.vue的四个生命阶段 2.vue的八个钩子 (1) beforeCreate:创建阶段前,script数据尚未加载 (2) created:创建阶段已完成 (3) beforeMount:挂载阶段前,开始通过数据进行页面渲染 (4) mounted:挂载阶段完毕 (5) beforeUpdate 阅读全文
posted @ 2023-10-19 20:51 子过杨梅 阅读(12) 评论(0) 推荐(0) 编辑
摘要:<div id="app6"> <div v-for="item in list">{{ item }}</div> </div> <script> const app6=new Vue({ el:'#app6', data:{ list:["1","2","3","4","5"] } }) </s 阅读全文
posted @ 2023-10-15 16:40 子过杨梅 阅读(2) 评论(0) 推荐(0) 编辑
摘要:<div id="app5"> <button @click="exchange(-5)">点我减五</button> <button @click="exchange(5)">点我加五</button> </div> <script> const app5=new Vue({ el:'#app5' 阅读全文
posted @ 2023-10-15 16:39 子过杨梅 阅读(2) 评论(0) 推荐(0) 编辑
摘要:<div id="app4"> <h3 v-show="display">别你妈逼点我</h3> <button @click="dian">老子就点你</button> </div> <script> const app4=new Vue({ el:"#app4", data:{ display: 阅读全文
posted @ 2023-10-08 10:55 子过杨梅 阅读(2) 评论(0) 推荐(0) 编辑
摘要:<div id="app3"> <button v-on:click="num++">+ </button> <span>{{ num }}</span> <button v-on:click="num--">- </button> <p v-if="num>10">帅</p> <p v-else- 阅读全文
posted @ 2023-10-08 10:54 子过杨梅 阅读(3) 评论(0) 推荐(0) 编辑
摘要:<div id="app2"> <div v-html="msg"></div> </div> <script> const app2=new Vue({ el:'#app2', data:{ msg: '<a href="https://cn.bing.com/search?q=%E5%A4%A7 阅读全文
posted @ 2023-10-05 14:43 子过杨梅 阅读(13) 评论(0) 推荐(0) 编辑
摘要:<div id="app"> <p> {{ message.toUpperCase() }}</p> <p>{{ age > 18?'成年':'未成年' }}</p> <p>{{ friend.name }}</p> <a href="">{{ con }}</a> <div class="box" 阅读全文
posted @ 2023-10-05 14:42 子过杨梅 阅读(16) 评论(0) 推荐(0) 编辑
摘要:if(this.chart '+'){ return this.num1*1 + this.num2*1 } 乘个一就i行啦! 阅读全文
posted @ 2023-09-30 13:45 子过杨梅 阅读(5) 评论(0) 推荐(0) 编辑

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