Skip to content

SwipeControl-DEMO ​


Swipe Control

vue
<fv-SwipeControl>
</fv-SwipeControl>

Slide Side

Only Right Side

vue
<fv-SwipeControl :disabledLeft="disabledLeft" :leftOptions="leftOptions" style="width: 80%; border: white solid thin;">
    <strong :style="{color: disabledLeft ? 'rgba(0, 98, 158, 1)' : 'rgba(248, 176, 75, 1)'}">{{disabledLeft ? 'Only Right Side' : 'Both Side'}}</strong>
</fv-SwipeControl>
  • leftOptions
javascript
export default {
    data () {
        return {
            leftOptions: [
                {
                    icon: 'QuietHours',
                    func: () => {},
                    type: 'tool',
                },
                {
                    icon: 'Info',
                    func: () => {},
                    type: 'info',
                }
            ]
        }
    }
}
>
Only Right Side

SwipeControl-Customize Options ​


Swipe Control

vue
<fv-SwipeControl :leftOptions="leftOptions" :options="options" :disabledLeft="false" style="width: 100%; border: white solid thin;">
</fv-SwipeControl>
  • options
  • leftOptions
javascript
export default {
    data () {
        return {
            options: [
                {
                    icon: 'Pin',
                    func: () => {},
                    type: 'warning',
                },
                {
                    icon: 'Delete',
                    func: () => {},
                    type: 'delete',
                }
            ],
            leftOptions: [
                {
                    icon: 'QuietHours',
                    func: () => {},
                    type: 'tool',
                },
                {
                    icon: 'Info',
                    func: () => {},
                    type: 'info',
                }
            ]
        }
    }
}

SwipeControl-With ListView ​


vue
<fv-ListView v-model="items" itemPadding="0">
    <template v-slot:listItem="x">
        <fv-swipe-control v-if="x.item.type != 'header'" :value="x.item" :leftOptions="leftOptions" :options="listOptions" :disabledLeft="false" style="width: 100%; height: 100%;">
            {{x.item.name}}
        </fv-swipe-control>
        <p v-else style="padding-left: 10px;">{{x.item.name}}</p>
    </template>
</fv-ListView>
  • items
  • options
  • leftOptions
javascript
export default {
    data () {
        return {
            items: [
                { key: "fruitsHeader", name: "Fruits", type: "header" },
                { key: "apple", name: "Apple" },
                { key: "banana", name: "Banana" },
                { key: "orange", name: "Orange", disabled: true },
                { key: "grape", name: "Grape" },
                { key: "divider_1", name: "", type: "divider" },
                { key: "vegetablesHeader", name: "Vegetables", type: "header" },
                { key: "broccoli", name: "Broccoli" },
                { key: "carrot", name: "Carrot" },
                { key: "lettuce", name: "Lettuce" }
            ],
            leftOptions: [
                {
                    icon: 'QuietHours',
                    func: () => {},
                    type: 'tool',
                },
                {
                    icon: 'Info',
                    func: () => {},
                    type: 'info',
                }
            ],
            listOptions: [
                {
                    icon: 'Pin',
                    func: () => {},
                    type: 'warning',
                },
                {
                    icon: 'Delete',
                    func: this.deleteItem,
                    type: 'delete',
                }
            ],
        }
    },
    methods: {
        deleteItem (item) {
            let index = this.items.findIndex(it => it.key === item.key);
            console.log(index, this.items[index].key, item.key);
            if(!item.disabled)
                this.items.splice(index, 1);
        }
    }
}

SwipeControl-Disabled ​


Swipe Control

vue
<fv-SwipeControl :leftOptions="leftOptions" :options="options" :disabledLeft="false" disabled style="width: 100%; border: white solid thin;">
</fv-SwipeControl>

Properties ​


PropertyTypeRequiredDefaultDescription
valueobjectNo{}See the SwipeControl value option.
minOpWidthnumberNo60See the SwipeControl minOpWidth option.
maxOpWidthnumberNo300See the SwipeControl maxOpWidth option.
leftOptionsarrayNo[]See the SwipeControl leftOptions option.
optionsanyNo[ { icon: 'Delete', func: () => {}, type: 'delete' } ]See the SwipeControl options option.
itemPaddingstringNo'0 10px'See the SwipeControl itemPadding option.
disabledLeftbooleanNotrueSee the SwipeControl disabledLeft option.
disabledRightbooleanNofalseSee the SwipeControl disabledRight option.
disabledLeftFullbooleanNotrueSee the SwipeControl disabledLeftFull option.
disabledRightFullbooleanNofalseSee the SwipeControl disabledRightFull option.
disabledbooleanNofalseSee the SwipeControl disabled option.
themestringNo'global'Theme style. Supports global, light, dark, system, and custom.
langstringNo"global"See the SwipeControl lang option.

Events ​


EventArgumentsDescription
status-changeStringSee the component status-change option.

Slots ​


  1. Default
vue
<template>
    <p></p>
</template>

Data ​


javascript
options = [{icon: '', text: '', type: '', disabled: ''}]

//e.g.//

options: [
    {
        icon: 'QuietHours',
        func: () => {},
        type: 'tool',
    },
    {
        icon: 'Info',
        func: () => {},
        type: 'info',
    }
]

MIT Licensed