propTypes.ts 684 B

1234567891011121314151617181920212223242526272829
  1. import { createTypes, VueTypesInterface, VueTypeValidableDef } from 'vue-types'
  2. import { CSSProperties } from 'vue'
  3. // 自定义扩展vue-types
  4. type PropTypes = VueTypesInterface & {
  5. readonly style: VueTypeValidableDef<CSSProperties>
  6. }
  7. const propTypes = createTypes({
  8. func: undefined,
  9. bool: undefined,
  10. string: undefined,
  11. number: undefined,
  12. object: undefined,
  13. integer: undefined
  14. }) as PropTypes
  15. // 需要自定义扩展的类型
  16. // see: https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#the-extend-method
  17. propTypes.extend([
  18. {
  19. name: 'style',
  20. getter: true,
  21. type: [String, Object],
  22. default: undefined
  23. }
  24. ])
  25. export { propTypes }