Skip to content

Commit

Permalink
feature: add example type Function to props (#114)
Browse files Browse the repository at this point in the history
* feature: add example type Function to props

* Apply suggestions from code review

Co-authored-by: Natalia Tepluhina <tarya.se@gmail.com>

Co-authored-by: Natalia Tepluhina <tarya.se@gmail.com>
  • Loading branch information
pikax and NataliaTepluhina authored Jun 12, 2020
1 parent 189453f commit f80fa6b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/guide/component-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
},
},
}
})
```
Expand Down

0 comments on commit f80fa6b

Please sign in to comment.