diff --git a/src/store.ts b/src/store.ts index 1c2bdd8497..eeaa095603 100644 --- a/src/store.ts +++ b/src/store.ts @@ -193,20 +193,20 @@ export default (Vue: VueConstructor): Store => { // @ts-ignore trueBase[trueEvent] = (...args: unknown[]) => { document.dispatchEvent( - new CustomEvent(`lssm_${event}_before`, { + new CustomEvent(`${PREFIX}_${event}_before`, { detail: args, }) ); state.hooks[event](...args); document.dispatchEvent( - new CustomEvent(`lssm_${event}_after`, { + new CustomEvent(`${PREFIX}_${event}_after`, { detail: args, }) ); }; } document.addEventListener( - `lssm_${event}_${post ? 'after' : 'before'}`, + `${PREFIX}_${event}_${post ? 'after' : 'before'}`, event => callback(...((event as unknown) as LSSMEvent).detail) ); @@ -241,7 +241,7 @@ export default (Vue: VueConstructor): Store => { // @ts-ignore trueBase.__proto__[event] = (...args: unknown[]) => { document.dispatchEvent( - new CustomEvent(`lssm_${eventString}_before`, { + new CustomEvent(`${PREFIX}_${eventString}_before`, { detail: args, }) ); @@ -250,14 +250,14 @@ export default (Vue: VueConstructor): Store => { ...args ); document.dispatchEvent( - new CustomEvent(`lssm_${eventString}_after`, { + new CustomEvent(`${PREFIX}_${eventString}_after`, { detail: args, }) ); }; } document.addEventListener( - `lssm_${eventString}_${post ? 'after' : 'before'}`, + `${PREFIX}_${eventString}_${post ? 'after' : 'before'}`, event => callback(...((event as unknown) as LSSMEvent).detail) );