refactor: portal should not expect ref target

This commit is contained in:
Evan You 2019-11-04 14:42:47 -05:00
parent 1a361e2e71
commit 957d3a0547
2 changed files with 2 additions and 6 deletions

View File

@ -39,7 +39,7 @@ describe('renderer: portal', () => {
const Comp = createComponent(() => () => const Comp = createComponent(() => () =>
h(Fragment, [ h(Fragment, [
h(Portal, { target }, h('div', 'teleported')), h(Portal, { target: target.value }, h('div', 'teleported')),
h('div', 'root') h('div', 'root')
]) ])
) )

View File

@ -680,11 +680,7 @@ export function createRenderer<
isSVG: boolean, isSVG: boolean,
optimized: boolean optimized: boolean
) { ) {
let targetSelector = n2.props && n2.props.target const targetSelector = n2.props && n2.props.target
if (isRef(targetSelector)) {
targetSelector = targetSelector.value
}
const { patchFlag, shapeFlag, children } = n2 const { patchFlag, shapeFlag, children } = n2
if (n1 == null) { if (n1 == null) {
const target = (n2.target = isString(targetSelector) const target = (n2.target = isString(targetSelector)