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) - }, -}