You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building using Vue / Vite / Quasar, and for the most part SoratbleJS is working very well. But, I have a challenge that in my <script setup> section, I set up my Sortable like this:
// Set up SortableconstquestionList=ref()Sortable.mount(newAutoScroll())watch(questionList,()=>{if(questionList.value){// Will catch regeneration if all elements are deleted and then more addedSortable.create(questionList.value,{// Now we have the div ref
...
That basically creates a Vue ref for the element I want to mount on, and triggers the watcher once that element is rendered in the DOM. But if I edit the source code and save it, Vite HMR reloads & reruns the setup function, and I get:
Uncaught (in promise) Sortable: Cannot mount plugin scroll more than once
In production this wouldn't be an issue, as the code would only ever be loaded / called once. But it's a pain in dev. Is there a method within Sortable to check if a plugin is already mounted? Or could this be a warning / silently ignored?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm building using Vue / Vite / Quasar, and for the most part SoratbleJS is working very well. But, I have a challenge that in my
<script setup>
section, I set up my Sortable like this:That basically creates a Vue ref for the element I want to mount on, and triggers the watcher once that element is rendered in the DOM. But if I edit the source code and save it, Vite HMR reloads & reruns the setup function, and I get:
In production this wouldn't be an issue, as the code would only ever be loaded / called once. But it's a pain in dev. Is there a method within Sortable to check if a plugin is already mounted? Or could this be a warning / silently ignored?
Beta Was this translation helpful? Give feedback.
All reactions