Skip to content

Commit

Permalink
fix(v-model): prevent double v-model update on functional components
Browse files Browse the repository at this point in the history
prevent double v-model update on functional components by not transforming model when
Ctor.options.functional is true

fix vuejs#8436
  • Loading branch information
wildan2711 committed Jul 31, 2018
1 parent 21112ec commit 4165efc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/vdom/create-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ export function createComponent (
// component constructor creation
resolveConstructorOptions(Ctor)

// transform component v-model data into props & events
if (isDef(data.model)) {
// transform component v-model data into props & events.
// make sure to transform model only once in functional components.
if (isDef(data.model) && !isTrue(Ctor.options.functional)) {
transformModel(Ctor.options, data)
}

Expand Down

0 comments on commit 4165efc

Please sign in to comment.