版博士V2.0程序
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

22 righe
633 B

  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