Introduction
Slicksort exports two components for quickly creating sortable lists. These have to be used together, or with the slot shorthand.
SlickListFor wrapping a list of items (API)SlickItemFor wrapping a single item and its content (API)
The functionality of these components are also available as mixins, by using the ContainerMixin and ElementMixin, you can make your own sortable components.
Try it out!
List A
group: 'a'accept: [
"b"
]- Item 1
- Item 2
- Item 3
List B
group: 'b'accept: true- Item 1
- Item 2
- Item 3
List C
group: 'c'accept: [
"b"
]- Item 1
- Item 2
- Item 3
v-models
lists: [
{
"id": 100,
"name": "List A",
"group": "a",
"accept": [
"b"
],
"items": [
{
"value": "Item 1",
"height": 52,
"background": "#eb5757",
"id": 101
},
{
"value": "Item 2",
"height": 93,
"background": "#9b51e1",
"id": 102
},
{
"value": "Item 3",
"height": 52,
"background": "#58cbf2",
"id": 103
}
]
},
{
"id": 104,
"name": "List B",
"group": "b",
"accept": true,
"items": [
{
"value": "Item 1",
"height": 117,
"background": "#eb5757",
"id": 105
},
{
"value": "Item 2",
"height": 70,
"background": "#9b51e1",
"id": 106
},
{
"value": "Item 3",
"height": 63,
"background": "#58cbf2",
"id": 107
}
]
},
{
"id": 108,
"name": "List C",
"group": "c",
"accept": [
"b"
],
"items": [
{
"value": "Item 1",
"height": 98,
"background": "#eb5757",
"id": 109
},
{
"value": "Item 2",
"height": 50,
"background": "#9b51e1",
"id": 110
},
{
"value": "Item 3",
"height": 114,
"background": "#58cbf2",
"id": 111
}
]
}
]