vue-i18n-extract-plugin 1.0.73 → 1.0.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/visitors.js +9 -2
- package/package.json +1 -1
package/lib/visitors.js
CHANGED
|
@@ -347,7 +347,10 @@ function createI18nVisitor(option, i18nMap) {
|
|
|
347
347
|
unwrapVueCacheCallIfNeeded(parentPath);
|
|
348
348
|
}
|
|
349
349
|
// 是否 vue.createElementVNode(...),且该 StringLiteral 是第三个参数
|
|
350
|
-
} else if (
|
|
350
|
+
} else if (
|
|
351
|
+
isVNodeCall(parentPath, "_createElementVNode") ||
|
|
352
|
+
isVNodeCall(parentPath, "_createElementBlock")
|
|
353
|
+
) {
|
|
351
354
|
const callExpr = parentPath.node;
|
|
352
355
|
const args = callExpr.arguments;
|
|
353
356
|
// 第 3 个参数是 children
|
|
@@ -360,7 +363,11 @@ function createI18nVisitor(option, i18nMap) {
|
|
|
360
363
|
} else {
|
|
361
364
|
args[3] = t.numericLiteral(1);
|
|
362
365
|
}
|
|
363
|
-
|
|
366
|
+
// 先尝试 [...(_cache2[4] || (_cache2[4] = [ createTextVNode(...) ]))]
|
|
367
|
+
if (!unwrapVueSlotArrayCache(parentPath)) {
|
|
368
|
+
// 再尝试拆 _cache2[0] || (_cache2[0] = createTextVNode(...))
|
|
369
|
+
unwrapVueCacheCallIfNeeded(parentPath);
|
|
370
|
+
}
|
|
364
371
|
}
|
|
365
372
|
} else {
|
|
366
373
|
const hasCreateVNode = transformDirectiveIfNeeded(path, parentPath);
|