props.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import type { PropType } from 'vue';
  2. import { useI18n } from '/@/hooks/web/useI18n';
  3. import { propTypes } from '/@/utils/propTypes';
  4. const { t } = useI18n('component.drawer');
  5. export const footerProps = {
  6. confirmLoading: propTypes.bool,
  7. /**
  8. * @description: Show close button
  9. */
  10. showCancelBtn: propTypes.bool.def(true),
  11. cancelButtonProps: Object as PropType<any>,
  12. cancelText: propTypes.string.def(t('cancelText')),
  13. /**
  14. * @description: Show confirmation button
  15. */
  16. showOkBtn: propTypes.bool.def(true),
  17. okButtonProps: propTypes.any,
  18. okText: propTypes.string.def(t('okText')),
  19. okType: propTypes.string.def('primary'),
  20. showFooter: propTypes.bool,
  21. footerHeight: {
  22. type: [String, Number] as PropType<string | number>,
  23. default: 60,
  24. },
  25. };
  26. export const basicProps = {
  27. isDetail: propTypes.bool,
  28. title: propTypes.string.def(''),
  29. showDetailBack: propTypes.bool.def(true),
  30. visible: propTypes.bool,
  31. loading: propTypes.bool,
  32. maskClosable: propTypes.bool.def(true),
  33. getContainer: {
  34. type: [Object, String] as PropType<any>,
  35. },
  36. scrollOptions: {
  37. type: Object as PropType<any>,
  38. default: null,
  39. },
  40. closeFunc: {
  41. type: [Function, Object] as PropType<any>,
  42. default: null,
  43. },
  44. triggerWindowResize: propTypes.bool,
  45. destroyOnClose: propTypes.bool,
  46. ...footerProps,
  47. };