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