lancelote-zpc

Results comments of lancelote-zpc

> deep设置为true 就可以监听到对象的变化 ```javascript let vm=new Vue({ el:"#first", data:{msg:{name:'北京'}}, watch:{ msg:{ handler (newMsg,oldMsg){ console.log(newMsg); }, immediate:true, deep:true } } }) ```

```javascript let vm=new Vue({ el:"#first", data:{msg:'liuneng'}, watch:{ msg:{ handler (newMsg,oldMsg){ console.log(newMsg); }, immediate:true } } }) ``` >设置immediate属性为true

rorute 它是一条路由, ,routes只是配置了一组路由, router 是一个机制 相当于管理者 ,用来管理路由 ,我是这么认为的 不知道对不对

```html 老八一号 老八二号 老八三号 老八四号 let a={ template:`奥里给 干了 兄弟们` }; let b={ template:`虽然不是同一个时间,但是是同一个撤所儿` }; let c={ template:`就吃老八秘制晓汉堡儿` }; let d={ template:`老八秘制晓汉堡 既便宜它还管饱` }; let routerObj=new VueRouter({ routes:[ {path:'/a',component:a,name:'一号'}, {path:'/b',component:b,name:'二号'}...

```html 老八一号 let a={ template:`奥里给 干了 兄弟们` }; let b={ template:`虽然不是同一个时间,但是是同一个撤所儿` }; let routeObj=new VueRouter({ routes:[ {path:'/a',redirect:'/b'}, {path:'/b',component:b} ] }); let vm=new Vue({ el:"#first", data:{}, router:routeObj }) ``` > redirect中写一个路径就可以

> 忘了说 还有一种是name的 ```html 乡村爱情 马大帅 let horse={ template:`水库浪子--范德彪` }; let horse2={ template:`我谢广坤这辈子没说过谢字` }; let routerObj=new VueRouter({ routes:[ {path:'/xiangcunlove', redirect:{name:'dashuai'}}, {path:'/horsebighandsome',component:horse}, {path:'/horsebighandsome2',component:horse2,name:'dashuai'}, ] }); let vm=new Vue({ el:'#first', router:routerObj })...