Skip to content

Commit

Permalink
fix: [web-components] #208 #209 #210 #211 #212
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgoud committed Oct 4, 2023
1 parent 0c1ac49 commit e3ec01c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
8 changes: 5 additions & 3 deletions packages/utils/v-custom-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ const directive: Directive = {
}
})
},
// beforeUnmount(el: HTMLInputElement) {
// el.removeEventListener('input', () => {})
// },
beforeUnmount(el: HTMLInputElement) {
el.removeEventListener('input', () => {
console.log('before unmount')
})
},
}

export const vCustomModelDirective = {
Expand Down
17 changes: 0 additions & 17 deletions playground/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
import { createApp } from 'vue'
// import { vCustomModelDirective } from '@puik/utils'
import App from './App.vue'
// import type { DirectiveBinding } from 'vue'
import '@puik/theme/src/index.scss'
import './assets/css/style.css'

const app = createApp(App)
// app.directive('custom-model', {
// 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', () => {})
// },
// })

app.mount('#app')

0 comments on commit e3ec01c

Please sign in to comment.