HerringtonDarkholme / av-ts

A modern, type-safe, idiomatic Vue binding library
MIT License
216 stars 11 forks source link

question - watch router #35

Closed Jacknq closed 7 years ago

Jacknq commented 7 years ago
@Watch<navbar, string>(function (this, newVal?: any, oldVal?: any) { // this.$route.path:string , newVal?:any, oldVal?:any 
            if (this.$route.path != undefined)
               console.log('Changed current path to: ' + this.$route.path);
        })
       '$route.path'

doesnt work anymore..

how do you watch routes nowdays? tried @Watch('$route.path') doesnt see that property

HerringtonDarkholme commented 7 years ago

Please read the doc. https://github.com/HerringtonDarkholme/av-ts#watch

@Watch(['$route', 'path']) should work.