mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2025-03-13 06:04:39 +08:00
Merge 453d99f90697b53e48def1dd49234f8b6d03f50b into 368e4bd9275a47804d4cadced37e9493b6bd80a3
This commit is contained in:
commit
a88c461d7d
@ -531,7 +531,11 @@ const transformJSXElement = (
|
||||
) {
|
||||
VNodeChild = t.objectExpression([
|
||||
t.objectProperty(t.identifier('default'), child),
|
||||
]);
|
||||
optimize && t.objectProperty(
|
||||
t.identifier('_'),
|
||||
t.numericLiteral(slotFlag),
|
||||
) as any,
|
||||
].filter(Boolean));
|
||||
} else if (t.isObjectExpression(child)) {
|
||||
VNodeChild = t.objectExpression(
|
||||
[
|
||||
@ -545,9 +549,13 @@ const transformJSXElement = (
|
||||
? t.objectExpression([
|
||||
t.objectProperty(
|
||||
t.identifier('default'),
|
||||
t.arrowFunctionExpression([], t.arrayExpression([child]))
|
||||
t.arrowFunctionExpression([], child),
|
||||
),
|
||||
])
|
||||
optimize && t.objectProperty(
|
||||
t.identifier('_'),
|
||||
t.numericLiteral(slotFlag),
|
||||
) as any,
|
||||
].filter(Boolean))
|
||||
: t.arrayExpression([child]);
|
||||
}
|
||||
}
|
||||
|
@ -208,7 +208,8 @@ _createVNode(_Fragment, null, [_createVNode(_resolveComponent("A"), null, {
|
||||
exports[`passing object slots via JSX children single expression, function expression > single expression, function expression 1`] = `
|
||||
"import { resolveComponent as _resolveComponent, createVNode as _createVNode } from "vue";
|
||||
_createVNode(_resolveComponent("A"), null, {
|
||||
default: () => "foo"
|
||||
default: () => "foo",
|
||||
_: 1
|
||||
});"
|
||||
`;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user