mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2025-02-10 23:49:09 +08:00
fix: only pass string when children is string
This commit is contained in:
parent
92db537e84
commit
4180c849ac
@ -358,7 +358,8 @@ const transformJSXElement = (t, path, state) => {
|
||||
.join(', ');
|
||||
|
||||
const isComponent = checkIsComponent(t, path.get('openingElement'));
|
||||
const child = children.elements.length === 1 ? children.elements[0] : children;
|
||||
const child = children.elements.length === 1 && t.isStringLiteral(children.elements[0])
|
||||
? children.elements[0] : children;
|
||||
if (state.opts.compatibleProps && !state.get('compatibleProps')) {
|
||||
state.set('compatibleProps', addDefault(
|
||||
path, '@ant-design-vue/babel-helper-vue-compatible-props', { nameHint: '_compatibleProps' },
|
||||
|
Loading…
Reference in New Issue
Block a user