You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

51 rivejä
1.6 KiB

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