props.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { defineMixin } from '../../libs/vue'
  2. import defProps from '../../libs/config/props.js'
  3. export const props = defineMixin({
  4. props: {
  5. // 控制打开或者关闭
  6. show: {
  7. type: Boolean,
  8. default: () => defProps.swipeActionItem.show
  9. },
  10. closeOnClick: {
  11. type: Boolean,
  12. default: () => defProps.swipeActionItem.closeOnClick
  13. },
  14. // 标识符,如果是v-for,可用index索引值
  15. name: {
  16. type: [String, Number],
  17. default: () => defProps.swipeActionItem.name
  18. },
  19. // 是否禁用
  20. disabled: {
  21. type: Boolean,
  22. default: () => defProps.swipeActionItem.disabled
  23. },
  24. // 是否自动关闭其他swipe按钮组
  25. autoClose: {
  26. type: Boolean,
  27. default: () => defProps.swipeActionItem.autoClose
  28. },
  29. // 滑动距离阈值,只有大于此值,才被认为是要打开菜单
  30. threshold: {
  31. type: Number,
  32. default: () => defProps.swipeActionItem.threshold
  33. },
  34. // 右侧按钮内容
  35. options: {
  36. type: Array,
  37. default() {
  38. return defProps.swipeActionItem.rightOptions
  39. }
  40. },
  41. // 动画过渡时间,单位ms
  42. duration: {
  43. type: [String, Number],
  44. default: () => defProps.swipeActionItem.duration
  45. }
  46. }
  47. })