wip: refs

This commit is contained in:
Evan You
2019-06-03 13:44:45 +08:00
parent 0ad31f29c4
commit 2848f65a7f
6 changed files with 69 additions and 14 deletions

View File

@@ -7,7 +7,8 @@ import {
isString,
isFunction,
isArray,
isObject
isObject,
isReservedProp
} from '@vue/shared'
import { warn } from './warning'
import { Data, ComponentInstance } from './component'
@@ -101,10 +102,8 @@ export function resolveProps(
if (rawProps != null) {
for (const key in rawProps) {
// key, ref, slots are reserved
if (key === 'key' || key === 'ref' || key === 'slots') {
continue
}
// key, ref are reserved
if (isReservedProp(key)) continue
// any non-declared data are put into a separate `attrs` object
// for spreading
if (hasDeclaredProps && !options.hasOwnProperty(key)) {