Skip to content

Commit

Permalink
fix: always set transformed model value on attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Feb 5, 2019
1 parent 1a6f7a5 commit b034abf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/vdom/create-component.js
Expand Up @@ -250,8 +250,7 @@ function mergeHook (f1: any, f2: any): Function {
function transformModel (options, data: any) {
const prop = (options.model && options.model.prop) || 'value'
const event = (options.model && options.model.event) || 'input'
const addTo = (options.props && prop in options.props) ? 'props' : 'attrs'
;(data[addTo] || (data[addTo] = {}))[prop] = data.model.value
;(data.attrs || (data.attrs = {}))[prop] = data.model.value
const on = data.on || (data.on = {})
const existing = on[event]
const callback = data.model.callback
Expand Down

0 comments on commit b034abf

Please sign in to comment.