# SwiperOut 侧滑菜单 - 图1 Wuss-weapp

首页

组件库

快速上手

GitHub

首页

组件库

快速上手

GitHub

基础组件

  • 布局

  • 导航

  • 操作反馈

  • 表单

# SwiperOut 侧滑菜单

# 使用指南

在 page.json 中引入组件

  1. "usingComponents": {
  2. "w-swiper-out": "wuss-weapp/w-swiper-out/index",
  3. }

# 视频演示

# 代码演示

  1. <w-pane title="SwiperOut" desc="侧滑菜单" />
  2. <w-pane desc="Default" />
  3. <w-swiper-out
  4. swiperOutBtns="{{ btns1 }}"
  5. data-itemid="sdadasdas123"
  6. bind:delete="delete"
  7. bind:edit="edit"
  8. bind:added="added"
  9. >
  10. <view class="example-content" style="" >
  11. Example Content
  12. </view>
  13. </w-swiper-out>
  14. <w-pane desc="Multiple" />
  15. <w-swiper-out
  16. swiperOutBtns="{{ btns2 }}"
  17. bind:delete="delete"
  18. bind:edit="edit"
  19. bind:added="added"
  20. >
  21. <view class="example-content" style="" >
  22. Example Content
  23. </view>
  24. </w-swiper-out>
  25. <w-pane desc="ButtonWidth = 50" />
  26. <w-swiper-out
  27. swiperOutBtns="{{ btns2 }}"
  28. bind:delete="delete"
  29. bind:edit="edit"
  30. bind:added="added"
  31. buttonWidth="50"
  32. >
  33. <view class="example-content" style="" >
  34. Example Content
  35. </view>
  36. </w-swiper-out>
  37. <w-pane desc="Close = True" />
  38. <w-swiper-out
  39. close
  40. swiperOutBtns="{{ btns1 }}"
  41. bind:delete="delete"
  42. bind:edit="edit"
  43. bind:added="added"
  44. >
  45. <view class="example-content" style="" >
  46. Example Content
  47. </view>
  48. </w-swiper-out>
  49. <w-pane desc="Threshold = 0.7" />
  50. <w-swiper-out
  51. swiperOutBtns="{{ btns1 }}"
  52. bind:delete="delete"
  53. bind:edit="edit"
  54. bind:added="added"
  55. threshold=".7"
  56. >
  57. <view class="example-content" style="" >
  58. Example Content
  59. </view>
  60. </w-swiper-out>
  61. <w-pane desc="AutoClose = False" />
  62. <w-swiper-out
  63. autoClose="{{false}}"
  64. swiperOutBtns="{{ btns2 }}"
  65. bind:delete="delete"
  66. bind:edit="edit"
  67. bind:added="added"
  68. >
  69. <view class="example-content" style="" >
  70. Example Content
  71. </view>
  72. </w-swiper-out>
  73. <w-pane desc="Disabled = True" />
  74. <w-swiper-out
  75. disabled
  76. swiperOutBtns="{{ btns2 }}"
  77. bind:delete="delete"
  78. bind:edit="edit"
  79. bind:added="added"
  80. >
  81. <view class="example-content" style="" >
  82. Example Content
  83. </view>
  84. </w-swiper-out>
  85. <w-pane desc="BackgroundColor = f8f8f8" />
  86. <w-swiper-out
  87. backgroundColor="#f8f8f8"
  88. swiperOutBtns="{{ btns2 }}"
  89. bind:delete="delete"
  90. bind:edit="edit"
  91. bind:added="added"
  92. >
  93. <view class="example-content" style="" >
  94. Example Content
  95. </view>
  96. </w-swiper-out>
data: {
  btns1: [
    {
      text: '添加',
      color: '#ffffff',
      background: '#28a745',
      disabled: false,
      size: '14px',
      type: 'added',
    },
    {
      text: '删除',
      color: '#ffffff',
      background: '#e42112',
      disabled: false,
      size: '14px',
      type: 'delete',
    },
  ],
  btns2: [
    {
      text: '添加',
      color: '#ffffff',
      background: '#28a745',
      disabled: false,
      size: '14px',
      type: 'added',
    },
    {
      text: '编辑',
      color: '#ffffff',
      background: '#ff8800',
      disabled: false,
      size: '14px',
      type: 'edit',
    },
    {
      text: '删除',
      color: '#ffffff',
      background: '#e42112',
      disabled: false,
      size: '14px',
      type: 'delete',
    },
  ],
},
added() {
  wx.showModal({
    title: '提示',
    content: 'added',
    showCancel: false,
  });
},
delete(e) {
  wx.showModal({
    title: '提示',
    content: 'delete',
    showCancel: false,
  });
},
edit() {
  wx.showModal({
    title: '提示',
    content: 'edit',
    showCancel: false,
  });
},
handleBtnClick(e) {
  const { onPress } = e.detail;
  onPress.call(this);
},
.example-content {
  display: flex;
  align-items: center;
  padding: 0 10px;
}

# API

# Attribute 属性

属性 说明 类型 默认值
swiperOutBtns 侧滑菜单按钮列表参数有 text,color,background,disabled array []
backgroundColor 背景颜色 string -
buttonWidth 按钮的宽度 number -
height 容器的高度 number -
threshold 侧滑触发的阀值 number -
close 是否展开 boolean false
autoClose 点击按钮自动收起 boolean false
disabled 禁用侧滑菜单 boolean false

# Event 事件

事件名 说明 参数

# Slot 插槽

名称 说明

# Class 自定义类名

类名 说明
wuss-class 根节点样式类

Edit this page

CountUp 指数 Marquee 垂直滚动视图