@vue/babel-plugin-jsx
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -79,9 +79,13 @@ "use strict"; | ||
*/ | ||
VNodeChild = isComponent ? t.objectExpression([ | ||
!!children.length && t.objectProperty(t.identifier('default'), t.arrowFunctionExpression([], t.arrayExpression(utils_1.buildIIFE(path, children)))), | ||
...(slots ? (t.isObjectExpression(slots) | ||
? slots.properties | ||
: [t.spreadElement(slots)]) : []), | ||
optimize && t.objectProperty(t.identifier('_'), t.numericLiteral(slotFlag)), | ||
].filter(Boolean)) : t.arrayExpression(children); | ||
VNodeChild = isComponent | ||
? children.length | ||
? t.objectExpression([ | ||
!!children.length && t.objectProperty(t.identifier('default'), t.arrowFunctionExpression([], t.arrayExpression(utils_1.buildIIFE(path, children)))), | ||
...(slots ? (t.isObjectExpression(slots) | ||
? slots.properties | ||
: [t.spreadElement(slots)]) : []), | ||
optimize && t.objectProperty(t.identifier('_'), t.numericLiteral(slotFlag)), | ||
].filter(Boolean)) | ||
: slots | ||
: t.arrayExpression(children); | ||
} | ||
@@ -88,0 +92,0 @@ else if (children.length === 1) { |
{ | ||
"name": "@vue/babel-plugin-jsx", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Babel plugin for Vue 3.0 JSX", | ||
@@ -5,0 +5,0 @@ "author": "Amour1688 <lcz_1996@foxmail.com>", |
@@ -241,6 +241,13 @@ # Babel Plugin JSX for Vue 3.0 | ||
```jsx | ||
const A = (props, { slots }) => ( | ||
<> | ||
<h1>{ slots.default ? slots.default() : 'foo' }</h1> | ||
<h2>{ slots.bar?.() }</h2> | ||
</> | ||
); | ||
const App = { | ||
setup() { | ||
const slots = { | ||
foo: () => <span>B</span>, | ||
bar: () => <span>B</span>, | ||
}; | ||
@@ -261,3 +268,3 @@ return () => ( | ||
default: () => <div>A</div>, | ||
foo: () => <span>B</span>, | ||
bar: () => <span>B</span>, | ||
}; | ||
@@ -276,3 +283,3 @@ return () => <A v-slots={slots} />; | ||
default: () => <div>A</div>, | ||
foo: () => <span>B</span>, | ||
bar: () => <span>B</span>, | ||
}} | ||
@@ -336,2 +343,13 @@ </A> | ||
</td> | ||
<td align="center"> | ||
<a target="_blank" href="https://github.com/leezng/vue-json-pretty"> | ||
<img | ||
height="32" | ||
style="vertical-align: -0.32em; margin-right: 8px;" | ||
src="https://raw.githubusercontent.com/leezng/vue-json-pretty/master/static/logo.svg" | ||
/> | ||
<br> | ||
<strong>Vue Json Pretty</strong> | ||
</a> | ||
</td> | ||
</tr> | ||
@@ -338,0 +356,0 @@ </tbody> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61727
1288
361