SortableJS / vue.draggable.next

Vue 3 compatible drag-and-drop component based on Sortable.js
https://sortablejs.github.io/vue.draggable.next/#/simple
MIT License
3.78k stars 518 forks source link

vite vue3 hmr 热更新失效 #256

Open yijiang0311 opened 6 months ago

yijiang0311 commented 6 months ago

页面中引用了这个组件后 热更新失效。 使用:

<script setup lang="ts">
import draggable from 'vuedraggable'
const list = ref([1, 2])
</script>

<template>
  <div class="LayerTest">
    <draggable
      :list="list"
      item-key="name"
      class="list-group"
      ghost-class="ghost"
    >
      <template #item="{ element }">
        <div class="list-group-item">
          {{ element }}
        </div>
      </template>
    </draggable>
  </div>
</template>

<style lang="scss" scoped>
</style>

控制台输出的日志如下: 3:59:07 PM [vite] hmr update /src/pages/editor/[id].vue (x2) 好像成功的日志。 但是网页是没有更新到最新的。

kuzroman commented 5 months ago

updating versions helped me image

barisener commented 5 months ago

same issue when use it with quasar framework.

Yoduh commented 1 month ago

same issue when use it with quasar framework.

Currently Quasar CLI scaffolds new projects with Vite v2.x. I resolved the issue with Quasar by upgrading to @quasar/app-vite v2 (which installs Vite v5.x) following their upgrade guide https://quasar.dev/quasar-cli-vite/upgrade-guide