appDirective.test-d.ts 318 B

1234567891011121314
  1. import { createApp } from 'vue'
  2. import { expectType } from './utils'
  3. const app = createApp({})
  4. app.directive<HTMLElement, string>('custom', {
  5. mounted(el, binding) {
  6. expectType<HTMLElement>(el)
  7. expectType<string>(binding.value)
  8. // @ts-expect-error not any
  9. expectType<number>(binding.value)
  10. },
  11. })