feat(core): allow passing explicit refs via props

This commit is contained in:
Evan You
2019-11-06 12:51:06 -05:00
parent e79c918676
commit d9c6ff372c
7 changed files with 76 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
import { readonly, toRaw, lock, unlock } from '@vue/reactivity'
import { toRaw, lock, unlock } from '@vue/reactivity'
import {
EMPTY_OBJ,
camelize,
@@ -200,12 +200,8 @@ export function resolveProps(
// lock readonly
lock()
instance.props = __DEV__ ? readonly(props) : props
instance.attrs = options
? __DEV__ && attrs != null
? readonly(attrs)
: attrs || EMPTY_OBJ
: instance.props
instance.props = props
instance.attrs = options ? attrs || EMPTY_OBJ : props
}
const normalizationMap = new WeakMap()