mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2024-11-10 09:39:14 +08:00
parent
e434f78f6f
commit
8ed497de1d
@ -36,7 +36,7 @@ const getJSXAttributeValue = (
|
||||
return transformJSXElement(valuePath, state);
|
||||
}
|
||||
if (valuePath.isStringLiteral()) {
|
||||
return valuePath.node;
|
||||
return transformJSXText(valuePath);
|
||||
}
|
||||
if (valuePath.isJSXExpressionContainer()) {
|
||||
return transformJSXExpressionContainer(valuePath);
|
||||
|
@ -138,7 +138,7 @@ export const getJSXAttributeName = (path: NodePath<t.JSXAttribute>): string => {
|
||||
* @returns StringLiteral | null
|
||||
*/
|
||||
export const transformJSXText = (
|
||||
path: NodePath<t.JSXText>
|
||||
path: NodePath<t.JSXText | t.StringLiteral>
|
||||
): t.StringLiteral | null => {
|
||||
const { node } = path;
|
||||
const lines = node.value.split(/\r\n|\n|\r/);
|
||||
|
Loading…
Reference in New Issue
Block a user