Skip to content

Commit 903c88c

Browse files
Merge branch 'master' of github.com:vuejs/docs-next
2 parents 23c1965 + f80fa6b commit 903c88c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/guide/component-props.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,15 @@ app.component('my-component', {
193193
// The value must match one of these strings
194194
return ['success', 'warning', 'danger'].indexOf(value) !== -1
195195
}
196-
}
196+
},
197+
// Function with a default value
198+
propG: {
199+
type: Function,
200+
// Unlike object or array default, this is not a factory function - this is a function to serve as a default value
201+
default: function () {
202+
return 'Default function'
203+
},
204+
},
197205
}
198206
})
199207
```

0 commit comments

Comments
 (0)