Skip to content

Commit

Permalink
Update element.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Aug 25, 2024
1 parent 66feea6 commit df1ac34
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/language-core/lib/codegen/template/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ function* generateReferencesForElements(
&& prop.name === 'ref'
&& prop.value
) {
let [content, startOffset] = normalizeAttributeValue(prop.value);
const [content, startOffset] = normalizeAttributeValue(prop.value);

yield `// @ts-ignore${newLine}`;
yield `__VLS_ctx`;
Expand Down Expand Up @@ -636,15 +636,8 @@ function* generateReferencesForScopedCssClasses(
}
}
else {
let [content, startOffset] = normalizeAttributeValue(prop.value);
let isWrapped = false;
if (
(content.startsWith(`'`) && content.endsWith(`'`))
|| (content.startsWith(`"`) && content.endsWith(`"`))
) {
content = content.slice(1, -1);
isWrapped = true;
}
const [content, startOffset] = normalizeAttributeValue(prop.value);
if (content) {
const classes = collectClasses(content, startOffset + (isWrapped ? 1 : 0));
ctx.scopedClasses.push(...classes);
Expand Down

0 comments on commit df1ac34

Please sign in to comment.