Skip to content

Commit

Permalink
fix: handle event correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX committed Aug 8, 2024
1 parent 8c83ee6 commit c309d9a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/language-service/lib/plugins/vue-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,15 @@ export function create(
const itemId = itemIdKey ? readInternalItemId(itemIdKey) : undefined;

if (itemId) {
const originalItem = originals.get(itemId.args[1]);
item.documentation = originalItem?.documentation;
let label = hyphenate(itemId.args[1]);
if (label.startsWith('on-')) {
label = 'on' + label.slice('on-'.length);
}
else if (itemId.type === 'componentEvent') {
label = 'on' + label;
}
const original = originals.get(label);
item.documentation = original?.documentation;
}
else if (!originals.has(item.label)) {
originals.set(item.label, item);
Expand Down

0 comments on commit c309d9a

Please sign in to comment.