# bz-swipe-action 滑动菜单
# 基本用法
滑动菜单,用于滑动操作的组件。
扫码预览
用BoosHi扫码或PC端点击
<template>
<view class="demo-ui-page">
<view class="demo-content">
<view class="demo-title">bz-swipe-action 滑出菜单</view>
<demo-cell noPadding>
<bz-swipe-action :actions="[{ name: '操作' }]">
<bz-cell title="一个按钮" showDivider></bz-cell>
</bz-swipe-action>
<bz-swipe-action
:actions="[{ name: '操作' }, { name: '删除', bgColor: '#FD3B31' }]"
>
<bz-cell title="两个按钮"></bz-cell>
</bz-swipe-action>
</demo-cell>
<demo-cell title="按钮不关闭" noPadding>
<bz-swipe-action :closable="false" :actions="[{ name: '操作' }]">
<bz-cell title="点击按钮不关闭" showDivider></bz-cell>
</bz-swipe-action>
<bz-swipe-action
:showMask="false"
:actions="[{ name: '操作' }, { name: '删除', bgColor: '#FD3B31' }]"
>
<bz-cell title="无遮罩,可滑其他"></bz-cell>
</bz-swipe-action>
</demo-cell>
<demo-cell title="状态" subTitle="open" noPadding>
<bz-swipe-action open :actions="[{ name: '操作' }]">
<bz-cell title="这是一个手动打开的菜单" showDivider></bz-cell>
</bz-swipe-action>
<bz-swipe-action
forbid
:actions="[{ name: '操作' }, { name: '删除', bgColor: '#FD3B31' }]"
>
<bz-cell title="禁止滑动"></bz-cell>
</bz-swipe-action>
</demo-cell>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
methods: {
handlerButton(details) {
console.log("点击了:", details);
},
},
};
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
展开 刷新 关闭
# 属性说明
属性名 | 类型 | 默认值 | 可选值 | 说明 |
---|---|---|---|---|
actions | { name: '按钮文本', bgColor: '按钮背景色', width: 70(自定义宽度) }[] | - | - | 菜单按钮数组 |
closable | Boolean | true | - | 点击按钮时是否自动关闭 |
showMask | Boolean | true | - | 设为 false,可以滑动多行不关闭菜单 |
operateWidth | Number | 80 | - | 按钮宽度 number 单位 px |
forbid | Boolean | false | - | 禁止滑动 |
open | Boolean | false | - | 手动打开关闭 |