版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

macros.d.ts 633 B

123456789101112131415161718192021
  1. import type { WritableComputedRef } from 'vue'
  2. import type { UseVModelOptions } from '@vueuse/core'
  3. export type UseModelOptions<T> = Omit<UseVModelOptions<T>, 'passive'> & {
  4. /**
  5. * When passive is set to `true`, it will use `watch` to sync with props and ref.
  6. * Instead of relying on the `v-model` or `.sync` to work.
  7. *
  8. * @default true
  9. */
  10. passive?: boolean
  11. }
  12. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  13. export type ModelOptions<T, O extends UseModelOptions<T> = {}> = T
  14. export const defineModel: <T>() => {
  15. [K in keyof T]-?: WritableComputedRef<T[K]>
  16. }
  17. export const $defineModel: <T>() => T