摘要:
引入 <script src="https://unpkg.com/vue-router/dist/vue-router.js"></script> 1、创建路由实例 // 创建index路由实例 let index = { template: '#index' } // 创建mine路由实例 le 阅读全文
摘要:
computed与data、methods等同级使用,默认只有getter计算属性 method、computed和watch的区别 computed属性的结果会被缓存,除非依赖的响应式属性变化才会重新计算。主要当作属性来使用,使用的时候不加(); methods方法表示一个具体的操作,主要书写业务 阅读全文
摘要:
1、给标签设置ref属性 <h2 ref='midautumn'>中秋快乐111</h2> 2、在mounted()中使用$refs对获取到的标签使用(methods与data等平级) mounted(){ //打印出所有带ref属性的值,是一个对象,{midautumn: h2, mid-autu 阅读全文
摘要:
watch和data、methods等同级 watch两个参数(newValue,odlValue) 分别为新数据和旧数据 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="widt 阅读全文