Skip to content

Commit f212bb4

Browse files
dasDanielchrisvfritz
authored andcommitted
render-function.md - options order (vuejs#1578)
for consistency with style-guide, the props should come before render https://vuejs.org/v2/style-guide/#Component-instance-options-order-recommended
1 parent f3aa2c0 commit f212bb4

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/v2/guide/render-function.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -504,14 +504,14 @@ In cases like this, we can mark components as `functional`, which means that the
504504
``` js
505505
Vue.component('my-component', {
506506
functional: true,
507+
// Props are optional
508+
props: {
509+
// ...
510+
},
507511
// To compensate for the lack of an instance,
508512
// we are now provided a 2nd context argument.
509513
render: function (createElement, context) {
510514
// ...
511-
},
512-
// Props are optional
513-
props: {
514-
// ...
515515
}
516516
})
517517
```
@@ -554,6 +554,13 @@ var UnorderedList = { /* ... */ }
554554

555555
Vue.component('smart-list', {
556556
functional: true,
557+
props: {
558+
items: {
559+
type: Array,
560+
required: true
561+
},
562+
isOrdered: Boolean
563+
},
557564
render: function (createElement, context) {
558565
function appropriateListComponent () {
559566
var items = context.props.items
@@ -570,13 +577,6 @@ Vue.component('smart-list', {
570577
context.data,
571578
context.children
572579
)
573-
},
574-
props: {
575-
items: {
576-
type: Array,
577-
required: true
578-
},
579-
isOrdered: Boolean
580580
}
581581
})
582582
```

0 commit comments

Comments
 (0)