Skip to content

Commit 8ed497d

Browse files
committed
fix(jsx): multiline property value
closes #598 closes #569
1 parent e434f78 commit 8ed497d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/babel-plugin-jsx/src/transform-vue-jsx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const getJSXAttributeValue = (
3636
return transformJSXElement(valuePath, state);
3737
}
3838
if (valuePath.isStringLiteral()) {
39-
return valuePath.node;
39+
return transformJSXText(valuePath);
4040
}
4141
if (valuePath.isJSXExpressionContainer()) {
4242
return transformJSXExpressionContainer(valuePath);

packages/babel-plugin-jsx/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export const getJSXAttributeName = (path: NodePath<t.JSXAttribute>): string => {
138138
* @returns StringLiteral | null
139139
*/
140140
export const transformJSXText = (
141-
path: NodePath<t.JSXText>
141+
path: NodePath<t.JSXText | t.StringLiteral>
142142
): t.StringLiteral | null => {
143143
const { node } = path;
144144
const lines = node.value.split(/\r\n|\n|\r/);

0 commit comments

Comments
 (0)