Skip to content

Commit 2ec3f43

Browse files
committed
fix options mixin example (close #92)
1 parent 5b1062b commit 2ec3f43

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/api/options.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,14 +428,16 @@ vm.a = 2 // -> new: 2, old: 1
428428

429429
The `mixins` option accepts an array of mixin objects. These mixin objects can contain instance options just like normal instance objects, and they will be merged against the eventual options using the same option merging logic in `Vue.extend()`. e.g. If your mixin contains a created hook and the component itself also has one, both functions will be called.
430430

431+
Mixin hooks are called in the order they are provided, and called before the component's own hooks.
432+
431433
**Example:**
432434

433435
``` js
434436
var mixin = {
435-
created: function () { console.log(2) }
437+
created: function () { console.log(1) }
436438
}
437439
var vm = new Vue({
438-
created: function () { console.log(1) },
440+
created: function () { console.log(2) },
439441
mixins: [mixin]
440442
})
441443
// -> 1

0 commit comments

Comments
 (0)