feat(runtime-core): add inheritRef option + make <transition> & <keep-alive> inherit refs

This commit is contained in:
Evan You
2020-05-22 10:26:02 -04:00
parent 88c1e626a7
commit 38f2d23a60
7 changed files with 30 additions and 6 deletions

View File

@@ -172,6 +172,10 @@ export function renderComponentRoot(
}
root.transition = vnode.transition
}
// inherit ref
if (Component.inheritRef && vnode.ref != null) {
root.ref = vnode.ref
}
if (__DEV__ && setRoot) {
setRoot(root)