From f80fa6b78cca89debac167b1554febf920b81d98 Mon Sep 17 00:00:00 2001 From: Carlos Rodrigues Date: Fri, 12 Jun 2020 16:27:25 +0100 Subject: [PATCH] feature: add example type Function to props (#114) * feature: add example type Function to props * Apply suggestions from code review Co-authored-by: Natalia Tepluhina Co-authored-by: Natalia Tepluhina --- src/guide/component-props.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/guide/component-props.md b/src/guide/component-props.md index 7505d2a819..a8a245d80b 100644 --- a/src/guide/component-props.md +++ b/src/guide/component-props.md @@ -193,7 +193,15 @@ app.component('my-component', { // The value must match one of these strings return ['success', 'warning', 'danger'].indexOf(value) !== -1 } - } + }, + // Function with a default value + propG: { + type: Function, + // Unlike object or array default, this is not a factory function - this is a function to serve as a default value + default: function () { + return 'Default function' + }, + }, } }) ```