fix: warning Fragment with condition fails with undefined vnode (#28)

This commit is contained in:
Amour1688 2020-07-14 10:38:34 +08:00 committed by GitHub
parent 672f27d258
commit 9179e9c7a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,6 @@ import {
getJSXAttributeName, getJSXAttributeName,
transformJSXText, transformJSXText,
transformJSXExpressionContainer, transformJSXExpressionContainer,
isFragment,
walksScope, walksScope,
} from './utils'; } from './utils';
import parseDirectives from './parseDirectives'; import parseDirectives from './parseDirectives';
@ -123,10 +122,6 @@ const buildProps = (path: NodePath<t.JSXElement>, state: State) => {
let slots: t.Identifier | t.Expression | null = null; let slots: t.Identifier | t.Expression | null = null;
let patchFlag = 0; let patchFlag = 0;
if (isFragment(path.get('openingElement').get('name'))) {
patchFlag |= PatchFlags.STABLE_FRAGMENT;
}
if (props.length === 0) { if (props.length === 0) {
return { return {
tag, tag,
@ -239,8 +234,6 @@ const buildProps = (path: NodePath<t.JSXElement>, state: State) => {
} }
} }
console.log(value)
if (directiveName === 'model' && value) { if (directiveName === 'model' && value) {
properties.push(t.objectProperty( properties.push(t.objectProperty(
t.stringLiteral(`onUpdate:${propName}`), t.stringLiteral(`onUpdate:${propName}`),