Skip to content

Commit

Permalink
fix: cannot update global components props completion list
Browse files Browse the repository at this point in the history
close #1196
  • Loading branch information
johnsoncodehk committed Apr 15, 2022
1 parent 183c80d commit c517b4b
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions packages/vue-typescript/src/vueFile.ts
Expand Up @@ -536,19 +536,11 @@ export function createVueFile(

const componentNames = components.map(entry => entry.name);

let dirty = false;

if (!eqSet(new Set(componentNames), new Set(templateScriptData.components))) {
dirty = true;
}

if (dirty) {
templateScriptData = {
projectVersion: newVersion,
components: componentNames,
componentItems: components,
};
}
templateScriptData = {
projectVersion: newVersion,
components: componentNames,
componentItems: components,
};

return templateScriptData;
}
Expand All @@ -565,12 +557,6 @@ export function createVueFile(
}
}

function eqSet<T>(as: Set<T>, bs: Set<T>) {
if (as.size !== bs.size) return false;
for (const a of as) if (!bs.has(a)) return false;
return true;
}

const validScriptSyntaxs = ['js', 'jsx', 'ts', 'tsx'] as const;

type ValidScriptSyntax = typeof validScriptSyntaxs[number];
Expand Down

0 comments on commit c517b4b

Please sign in to comment.