Skip to content

Instantly share code, notes, and snippets.

@danielschmitz
Last active July 16, 2016 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielschmitz/2f5cea465679404bce2647ede1d598c8 to your computer and use it in GitHub Desktop.
Save danielschmitz/2f5cea465679404bce2647ede1d598c8 to your computer and use it in GitHub Desktop.
import { VueComponent, Prop, Watch } from 'vue-typescript'
class Link {
name:string;
path:string;
constructor(name:string, path:string){
this.name = name;
this.path = path;
}
}
@VueComponent({
template: require('./navbar.html')
})
export class Navbar extends Vue {
@Prop
inverted:boolean = true; //default value
links:Link[] = [
new Link('Home', '/'),
new Link('About', '/about')
]
@Watch('$route.path')
pathChanged(){
console.log('Changed current path to: ' + this.$route.path);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment