2020-08-27 17:18:57 +08:00

47 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
layout: templateLayout
---
```vue
<template>
<Draggable v-model="list" @on-sort-ready="dragready" @on-sort-end="dragend" class="category-draggable">
<template slot-scope="{item, index}">
<p>{{item.content}}</p>
</template>
</Draggable>
<!--注意vue2.5以下的写法有所不同-->
<Draggable v-model="list" @on-sort-ready="dragready" @on-sort-end="dragend" class="category-draggable">
<template scope="{item, index}">
<p>{{item.content}}</p>
</template>
</Draggable>
</template>
<script>
export default {
data: function () {
return {
list: [
{
content: '序号一',
key: 1
},
{
content: '序号二',
key: 2
},
{
content: '序号三',
key: 3
}
]
}
},
methods: {
}
}
</script>
<style>
.ui-dragging-item{
background: #eee;
}
</style>
```