Skip to content

Commit

Permalink
fix(vue): convert just atom prefixed events to kebab case on install (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
felipefialho authored Jun 17, 2024
1 parent bda5c6b commit c40200f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/vue/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ export const ComponentLibrary: Plugin = {
async install() {
applyPolyfills().then(() => {
defineCustomElements(window, {
ael: (el: any, eventName: string, cb: any, opts: any) =>
el.addEventListener(eventName.toLowerCase(), cb, opts),
rel: (el: any, eventName: string, cb: any, opts: any) =>
el.removeEventListener(eventName.toLowerCase(), cb, opts),
ce: (eventName: string, opts: any) =>
new CustomEvent(toKebabCase(eventName), opts),
new CustomEvent(
eventName.startsWith('atom') ? toKebabCase(eventName) : eventName,
opts
),
} as any)
})
},
Expand Down

0 comments on commit c40200f

Please sign in to comment.