mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2025-05-24 19:24:24 +08:00
chore: update
This commit is contained in:
parent
066532d823
commit
a9545418e7
@ -120,10 +120,7 @@ export default declare<VueJSXPluginOptions, BabelCore.PluginObj<State>>(
|
||||
});
|
||||
}
|
||||
|
||||
const vueImportMap: Record<
|
||||
string,
|
||||
(t.MemberExpression | t.Identifier)[]
|
||||
> = {};
|
||||
const vueImportMap: Record<string, t.Identifier[]> = {};
|
||||
state.set('vueImportMap', vueImportMap);
|
||||
path.node.body.forEach((statement) => {
|
||||
if (t.isImportDeclaration(statement)) {
|
||||
|
@ -38,10 +38,11 @@ export const shouldTransformedToSlots = (tag: string, state?: State) => {
|
||||
if (state) {
|
||||
const vueImportMap = state.get('vueImportMap');
|
||||
for (const name of [FRAGMENT, KEEP_ALIVE]) {
|
||||
if (vueImportMap[name]) {
|
||||
if (vueImportMap[name].some((id: t.Identifier) => id.name === tag)) {
|
||||
return false;
|
||||
}
|
||||
if (
|
||||
vueImportMap[name] &&
|
||||
vueImportMap[name].some((id: t.Identifier) => id.name === tag)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user