🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] ## useSortable 可进行排序 ``` <script setup lang="ts"> import { useSortable } from '@vueuse/integrations/useSortable' import { ref } from 'vue' const el = ref<HTMLElement | null>(null) const list = ref([{ id: 1, name: 'a' }, { id: 2, name: 'b' }, { id: 3, name: 'c' }]) useSortable(el, list) </script> <template> <div ref="el"> <div v-for="item in list" :key="item.id"> {{ item.name }} </div> </div> </template> ```