How to use the JSXExpressionContainer function from @babel/types
Find comprehensive JavaScript @babel/types.JSXExpressionContainer code examples handpicked from public code repositorys.
70 71 72 73 74 75 76 77 78 79
}, JSXText(path) { const { node } = path; if (judgeChinese(node.value)) { path.replaceWith( t.JSXExpressionContainer(makeReplace({ value: node.value.trim().replace(/\n\s+/g, "\n") })) ); }
19
62
2
GitHub: nolatercn/vue-auto-i18n
108 109 110 111 112 113 114 115 116 117
// 值是否包含中文 if (baseUtils.isChinese(node.value.value)) { // 过滤特殊属性 if (!options.ignoreTagAttr.includes(node.name.name)) { // 改为动态属性 node.value = t.JSXExpressionContainer(StringLiteral(node.value.value)) } } } // path.skip() // 跳过子节点
0
0
0
@babel/types.identifier is the most popular function in @babel/types (20936 examples)