|
@ -20,7 +20,8 @@ import { |
|
|
isReserved, |
|
|
isReserved, |
|
|
handleError, |
|
|
handleError, |
|
|
validateProp, |
|
|
validateProp, |
|
|
isPlainObject |
|
|
isPlainObject, |
|
|
|
|
|
isReservedAttribute |
|
|
} from '../util/index' |
|
|
} from '../util/index' |
|
|
|
|
|
|
|
|
const sharedPropertyDefinition = { |
|
|
const sharedPropertyDefinition = { |
|
@ -54,12 +55,6 @@ export function initState (vm: Component) { |
|
|
if (opts.watch) initWatch(vm, opts.watch) |
|
|
if (opts.watch) initWatch(vm, opts.watch) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const isReservedProp = { |
|
|
|
|
|
key: 1, |
|
|
|
|
|
ref: 1, |
|
|
|
|
|
slot: 1 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function checkOptionType (vm: Component, name: string) { |
|
|
function checkOptionType (vm: Component, name: string) { |
|
|
const option = vm.$options[name] |
|
|
const option = vm.$options[name] |
|
|
if (!isPlainObject(option)) { |
|
|
if (!isPlainObject(option)) { |
|
@ -84,7 +79,7 @@ function initProps (vm: Component, propsOptions: Object) { |
|
|
const value = validateProp(key, propsOptions, propsData, vm) |
|
|
const value = validateProp(key, propsOptions, propsData, vm) |
|
|
/* istanbul ignore else */ |
|
|
/* istanbul ignore else */ |
|
|
if (process.env.NODE_ENV !== 'production') { |
|
|
if (process.env.NODE_ENV !== 'production') { |
|
|
if (isReservedProp[key] || config.isReservedAttr(key)) { |
|
|
if (isReservedAttribute(key) || config.isReservedAttr(key)) { |
|
|
warn( |
|
|
warn( |
|
|
`"${key}" is a reserved attribute and cannot be used as component prop.`, |
|
|
`"${key}" is a reserved attribute and cannot be used as component prop.`, |
|
|
vm |
|
|
vm |
|
|