props.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import { defineProps } from '../../libs/util/props';
  2. export default defineProps('fab', {
  3. // 是否激活
  4. active: {
  5. type: Boolean,
  6. default: false
  7. },
  8. // 类型
  9. type: {
  10. type: String,
  11. default: 'primary'
  12. },
  13. // 悬浮按钮位置
  14. position: {
  15. type: String,
  16. default: 'right-bottom'
  17. },
  18. // 按钮拖动模式:'auto'(自动吸附)、'free'(自由拖动)、'none'(不可拖动)
  19. draggable: {
  20. type: String,
  21. default: 'auto'
  22. },
  23. // 悬浮按钮菜单弹出方向
  24. direction: {
  25. type: String,
  26. default: 'top'
  27. },
  28. // 是否禁用
  29. disabled: {
  30. type: Boolean,
  31. default: false
  32. },
  33. // 悬浮按钮未展开时的图标
  34. inactiveIcon: {
  35. type: String,
  36. default: 'plus'
  37. },
  38. // 悬浮按钮展开时的图标
  39. activeIcon: {
  40. type: String,
  41. default: 'close'
  42. },
  43. // 悬浮按钮大小
  44. size: {
  45. type: [String, Number],
  46. default: 56
  47. },
  48. // 自定义悬浮按钮层级
  49. zIndex: {
  50. type: [String, Number],
  51. default: 9999
  52. },
  53. // 自定义悬浮按钮与可视区域边缘的间距
  54. gap: {
  55. type: Object,
  56. default: () => ({
  57. top: 16,
  58. left: 16,
  59. right: 16,
  60. bottom: 16
  61. })
  62. },
  63. // 用于控制点击时是否展开菜单
  64. expandable: {
  65. type: Boolean,
  66. default: true
  67. }
  68. })