From 95cb95ef5e07dbf04c8acd6b188d1bee9e4a1d51 Mon Sep 17 00:00:00 2001 From: Matthias Goudjil Date: Thu, 12 Oct 2023 12:47:45 +0200 Subject: [PATCH] refactor: remove v-custom-model directive --- packages/utils/index.ts | 1 - packages/utils/v-custom-model.ts | 25 ------------------------- 2 files changed, 26 deletions(-) delete mode 100644 packages/utils/v-custom-model.ts diff --git a/packages/utils/index.ts b/packages/utils/index.ts index 6aea3516..20ea01d9 100644 --- a/packages/utils/index.ts +++ b/packages/utils/index.ts @@ -7,4 +7,3 @@ export * from './types' export * from './typescript' export * from './isEllipsisActive' export * from './clamp' -export * from './v-custom-model' diff --git a/packages/utils/v-custom-model.ts b/packages/utils/v-custom-model.ts deleted file mode 100644 index 10eab312..00000000 --- a/packages/utils/v-custom-model.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { App, Directive, DirectiveBinding } from 'vue' - -const directive: Directive = { - mounted(el: HTMLInputElement, binding: DirectiveBinding) { - el.addEventListener('input', (event) => { - if (event.target) { - binding.instance?.$emit( - binding.arg!, - (event.target as HTMLInputElement).value - ) - } - }) - }, - beforeUnmount(el: HTMLInputElement) { - el.removeEventListener('input', () => { - console.log('before unmount') - }) - }, -} - -export const vCustomModelDirective = { - install(app: App) { - app.directive('custom-model', directive) - }, -}