From e3dd1dc324cace1a81ee81783bbecf9de1b5f565 Mon Sep 17 00:00:00 2001 From: 2096903746 <57122446+2096903746@users.noreply.github.com> Date: Tue, 4 Jul 2023 19:12:03 +0800 Subject: [PATCH] Update index.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit jsx属性过滤换行符 --- packages/babel-plugin-transform-vue-jsx/src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/babel-plugin-transform-vue-jsx/src/index.js b/packages/babel-plugin-transform-vue-jsx/src/index.js index e36143a..2ca7568 100644 --- a/packages/babel-plugin-transform-vue-jsx/src/index.js +++ b/packages/babel-plugin-transform-vue-jsx/src/index.js @@ -173,6 +173,7 @@ const parseAttributeJSXAttribute = (t, path, attributes, tagName, elementType) = if (!valuePath.node) { value = t.booleanLiteral(true) } else if (t.isStringLiteral(valuePath)) { + valuePath.node.value = valuePath.node.value.replace(/\n\s+/g, ' ') value = valuePath.node } else { /* istanbul ignore else */