2021年7月31日

vue中watch的用法

摘要: 在Vue中,用watch来响应数据的变化,示例代码如下, 第一种方式 <input type="text" v-model="userName"/> //监听当userName值发生变化时触发 watch: { userName (newName, oldName) { console.log(ne 阅读全文

posted @ 2021-07-31 19:48 少林寺的智清大师 阅读(656) 评论(0) 推荐(0)

路由导航的两种方式

摘要: 声明式:router-link 通过标签的方式进行跳转 一、<router-link :to="..."> to里的值可以是一个字符串路径,或者一个描述地址的对象。例如: // 字符串<router-link to="apple"> to apple</router-link>// 对象<route 阅读全文

posted @ 2021-07-31 10:11 少林寺的智清大师 阅读(226) 评论(0) 推荐(0)

导航