Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agonbina/vue-sortable-mixin
[Not maintained] Keep in sync a list(array) of data in a Vue.js view model with jQueryUI sortable
https://github.com/agonbina/vue-sortable-mixin
Last synced: about 1 month ago
JSON representation
[Not maintained] Keep in sync a list(array) of data in a Vue.js view model with jQueryUI sortable
- Host: GitHub
- URL: https://github.com/agonbina/vue-sortable-mixin
- Owner: agonbina
- License: mit
- Created: 2014-11-26T07:04:01.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-01T18:26:51.000Z (about 10 years ago)
- Last Synced: 2024-12-11T05:49:03.403Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 160 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
vue-sortable-mixin
==================Keep in sync a list(array) of data in a Vue.js view model with jQueryUI Sortable
## Usage
```bash
npm install --save vue-sortable-mixin
```## Example
```js
var sortableMixin = require('vue-sortable-mixin');var MyComponent = Vue.extend({
mixins: [ sortableMixin ],template: '
data: function() {
return {
positions: [ 'striker', 'defender', 'midfielder' ],
$sortable: {
key: 'positions' // Default is 'elements'
}
}
}
})
```
Now the ```positions``` indexes will stay intact with any changes on the order of the dom elements they are bound to.
You can pass any of the regular $.fn.sortable options to ```$sortable``` in your data, including a
special ```$el``` selector if your sortable DOM element is not the default viewModel.$el