Skip to content

Commit

Permalink
render-function.md - options order (vuejs#1578)
Browse files Browse the repository at this point in the history
for consistency with style-guide, the props should come before render
https://vuejs.org/v2/style-guide/#Component-instance-options-order-recommended
  • Loading branch information
dasDaniel authored and chrisvfritz committed Apr 13, 2018
1 parent f3aa2c0 commit f212bb4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/v2/guide/render-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -504,14 +504,14 @@ In cases like this, we can mark components as `functional`, which means that the
``` js
Vue.component('my-component', {
functional: true,
// Props are optional
props: {
// ...
},
// To compensate for the lack of an instance,
// we are now provided a 2nd context argument.
render: function (createElement, context) {
// ...
},
// Props are optional
props: {
// ...
}
})
```
Expand Down Expand Up @@ -554,6 +554,13 @@ var UnorderedList = { /* ... */ }

Vue.component('smart-list', {
functional: true,
props: {
items: {
type: Array,
required: true
},
isOrdered: Boolean
},
render: function (createElement, context) {
function appropriateListComponent () {
var items = context.props.items
Expand All @@ -570,13 +577,6 @@ Vue.component('smart-list', {
context.data,
context.children
)
},
props: {
items: {
type: Array,
required: true
},
isOrdered: Boolean
}
})
```
Expand Down

0 comments on commit f212bb4

Please sign in to comment.