Skip to content

Commit 2bb9f70

Browse files
committed
Updated to 0.5.2 anf added default object prop example
1 parent 7969634 commit 2bb9f70

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
"jquery": "^2.2.4",
3535
"vue": "^1.0.26",
3636
"vue-router": "^0.7.13",
37-
"vue-typescript": "^0.5.1"
37+
"vue-typescript": "^0.5.2"
3838
}
3939
}

src/components/navbar/navbar.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export class Navbar extends Vue {
1919
@Prop
2020
inverted:boolean = true; //default value
2121

22+
@Prop
23+
object:{default:string} = {default: 'Default object property!'}; //objects as default values don't need to be wrapped into functions
24+
2225
links:Link[] = [
2326
new Link('Home', '/'),
2427
new Link('About', '/about')
@@ -28,4 +31,8 @@ export class Navbar extends Vue {
2831
pathChanged(){
2932
console.log('Changed current path to: ' + this.$route.path);
3033
}
34+
35+
ready(){
36+
console.log(this.object.default);
37+
}
3138
}

0 commit comments

Comments
 (0)