src/core/vdom/create-component.js
// prop and event handler respectively.
prop and event handler respectively.
prop and event handler respectively .
function transformModel(options, data) {
  const prop = (options.model && options.model.prop) || 'value'
  const event = (options.model && options.model.event) || 'input'
  ;(data.attrs || (data.attrs = {}))[prop] = data.model.value
  const on = data.on || (data.on = {})
  const existing = on[event]
  const callback = data.model.callback
  if (isDef(existing)) {
    if (
      Array.isArray(existing)
        ? existing.indexOf(callback) === -1
        : existing !== callback
    ) {
      on[event] = [callback].concat(existing)
    } else {
      on[event] = callback
    }
  }
}
function transformModel ( options , data ) { const prop = ( options . model && options . model . prop ) || 'value' const event = ( options . model && options . model . event ) || 'input' ; ( data . attrs || ( data . attrs = { } ) ) [ prop ] = data . model . value const on = data . on || ( data . on = { } ) const existing = on [ event ] const callback = data . model . callback if ( isDef ( existing ) ) { if ( Array . isArray ( existing ) ? existing . indexOf ( callback ) === - 1 : existing !== callback ) { on [ event ] = [ callback ] . concat ( existing ) } else { on [ event ] = callback } } }
prop and event handler respectively.
prop and event handler respectively .