<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Carlos Jorge Rodriguez</title>
    <description>The latest articles on Forem by Carlos Jorge Rodriguez (@carlosjorger).</description>
    <link>https://forem.com/carlosjorger</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1342035%2F7f0e0b6f-be4a-4991-a7d3-2c046647485c.png</url>
      <title>Forem: Carlos Jorge Rodriguez</title>
      <link>https://forem.com/carlosjorger</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/carlosjorger"/>
    <language>en</language>
    <item>
      <title>Vue Fluid DnD v0.7 Drag and drop across lists and more</title>
      <dc:creator>Carlos Jorge Rodriguez</dc:creator>
      <pubDate>Fri, 23 Aug 2024 13:19:57 +0000</pubDate>
      <link>https://forem.com/carlosjorger/vue-fluid-dnd-v07-drag-and-drop-across-lists-and-more-543k</link>
      <guid>https://forem.com/carlosjorger/vue-fluid-dnd-v07-drag-and-drop-across-lists-and-more-543k</guid>
      <description>&lt;p&gt;We are excited to announce the release of &lt;strong&gt;Vue Fluid DnD&lt;/strong&gt; Version 0.7. We add new features that significantly expand the range of use cases for our humble library and solving bugs of the previous version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drag and drop between two or more lists
&lt;/h2&gt;

&lt;p&gt;To provide a more versatile solution, in this version you can drag and drop elements between groups of lists (can be vertical or horizontal list). Also, the rearranging of the elements after dragging one from a list to another have fluid animations too.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdzur6j9hssqkic06xv9i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdzur6j9hssqkic06xv9i.png" title="Dragging an element between lists" alt="group of list" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add draggingClass config
&lt;/h2&gt;

&lt;p&gt;With &lt;code&gt;draggingClass&lt;/code&gt; you can pass a &lt;strong&gt;CSS class selector&lt;/strong&gt; that will be added to the element while&lt;br&gt;
it´s being dragged.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F71jr8ylvd6q7bqjkyoqm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F71jr8ylvd6q7bqjkyoqm.png" title="Change background when an element is dragged" alt="draggingClass" width="800" height="731"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add delay to draggable elements on touch screen
&lt;/h2&gt;

&lt;p&gt;To make it more accessible on the mobile view. We add a delay before drag the element to facilitate navigation through the list with a touch device.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fixing Bugs
&lt;/h2&gt;

&lt;p&gt;Thanks for the feedback of the community specially from &lt;a href="https://github.com/carlosjorger/vue-fluid-dnd" rel="noopener noreferrer"&gt;github&lt;/a&gt;  and &lt;a href="https://www.reddit.com/user/carlosjorgerc/" rel="noopener noreferrer"&gt;reddit&lt;/a&gt;. We're manage to solve compatibility issues with other browsers and the touch view.&lt;/p&gt;

&lt;p&gt;We invite you to try this new, much more mature version of &lt;strong&gt;Vue Fluid DnD&lt;/strong&gt; and give us feedback through &lt;a href="https://github.com/carlosjorger/vue-fluid-dnd" rel="noopener noreferrer"&gt;github&lt;/a&gt; or this &lt;a href="//mailto:rodriguezcuelloc@gmail.com"&gt;rodriguezcuelloc@gmail.com&lt;/a&gt;. &lt;/p&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
      <category>typescript</category>
      <category>npm</category>
    </item>
    <item>
      <title>Enhance the drag and drop of your Vue 3 application with Vue Fluid DnD</title>
      <dc:creator>Carlos Jorge Rodriguez</dc:creator>
      <pubDate>Sat, 27 Apr 2024 19:48:30 +0000</pubDate>
      <link>https://forem.com/carlosjorger/enhance-the-drag-and-drop-of-your-vue-3-application-with-vue-fluid-dnd-5acg</link>
      <guid>https://forem.com/carlosjorger/enhance-the-drag-and-drop-of-your-vue-3-application-with-vue-fluid-dnd-5acg</guid>
      <description>&lt;p&gt;In web applications that use &lt;strong&gt;Single-Page Application&lt;/strong&gt; frameworks like &lt;strong&gt;Vue&lt;/strong&gt;, &lt;strong&gt;React&lt;/strong&gt;, &lt;strong&gt;Angular&lt;/strong&gt;, etc., the need to organize lists or other collections of elements by sorting them, adding, removing, or moving elements within them is very common. &lt;br&gt;
The &lt;strong&gt;Vue&lt;/strong&gt; ecosystem is not as rich as &lt;strong&gt;React's&lt;/strong&gt;, and while there are good drag and drop solutions for &lt;strong&gt;Vue&lt;/strong&gt;, most of them are wrappers of other libraries (like &lt;strong&gt;Vue draggable&lt;/strong&gt; based on &lt;strong&gt;Sortablejs&lt;/strong&gt;), lack sufficient maintenance, or do not support &lt;strong&gt;Vue 3&lt;/strong&gt;.&lt;br&gt;
With &lt;a href="https://vue-fluid-dnd.netlify.app/" rel="noopener noreferrer"&gt;drag and drop library: Vue Fluid DnD&lt;/a&gt;, we present a new solution inspired by the user-friendliness of &lt;a href="https://drag-and-drop.formkit.com/" rel="noopener noreferrer"&gt;drag and drop from formkit&lt;/a&gt;, the animations of &lt;a href="https://react-beautiful-dnd.netlify.app/" rel="noopener noreferrer"&gt;react-beautiful-dnd&lt;/a&gt;, and more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vue Fluid DnD in action
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;First, install &lt;a href="https://www.npmjs.com/package/vue-fluid-dnd" rel="noopener noreferrer"&gt;vue-fluid-dnd&lt;/a&gt; on the current project:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i vue-fluid-dnd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Import the library and use of its simple API to pass the list of numbers to be sorted as a parameter.:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt; &lt;span class="na"&gt;setup&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"ts"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useDragAndDrop&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue-fluid-dnd&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;parent&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useDragAndDrop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The variable &lt;code&gt;parent&lt;/code&gt; contains the reference to the container of the items to be sorted, which is passed by reference to the &lt;code&gt;ul&lt;/code&gt; element, and for each item, the position of this item in the list (&lt;code&gt;index&lt;/code&gt;) is also passed:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;ul&lt;/span&gt; &lt;span class="na"&gt;ref=&lt;/span&gt;&lt;span class="s"&gt;"parent"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"number-list"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"number"&lt;/span&gt; &lt;span class="na"&gt;v-for=&lt;/span&gt;&lt;span class="s"&gt;"(element, index) in list"&lt;/span&gt; &lt;span class="na"&gt;:index=&lt;/span&gt;&lt;span class="s"&gt;"index"&lt;/span&gt; &lt;span class="na"&gt;:key=&lt;/span&gt;&lt;span class="s"&gt;"number"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        {{ element }}
        &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Add some styles to the list:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nl"&gt;border-style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nl"&gt;padding-left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nl"&gt;margin-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.25rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nl"&gt;border-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nl"&gt;border-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.number-list&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="py"&gt;padding-inline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;25px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;It looks like this:
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffam6um7ehukjosm4l8ta.png" alt="number list" width="800" height="202"&gt;
&lt;/li&gt;
&lt;li&gt;Thanks to &lt;strong&gt;Vue Fluid DnD&lt;/strong&gt; you can drag the elements and sort the list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcmkr7mnj44ade7brgvmd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcmkr7mnj44ade7brgvmd.png" alt="number list using drag and drop" width="800" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's more could you drag and drop?
&lt;/h2&gt;

&lt;p&gt;And this is it. With this as a base, you should be able to drag and drop simple lists of elements on Vue 3 applications. But why should you stop there?&lt;/p&gt;

&lt;p&gt;These are other features of the &lt;strong&gt;Vue Fluid DnD&lt;/strong&gt; library not discussed in this article include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://vue-fluid-dnd.netlify.app/guides/verticallistautoscroll/" rel="noopener noreferrer"&gt;Lists with a scroll&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vue-fluid-dnd.netlify.app/guides/horizontallist/" rel="noopener noreferrer"&gt;Horizontal lists&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vue-fluid-dnd.netlify.app/guides/listhandler/" rel="noopener noreferrer"&gt;Lists with handlers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vue-fluid-dnd.netlify.app/guides/isdraggable/" rel="noopener noreferrer"&gt;Determine whether or not a given element should be draggable&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vue-fluid-dnd.netlify.app/guides/listgroup/" rel="noopener noreferrer"&gt;Drag an drop between lists&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vue-fluid-dnd.netlify.app/guides/listinputs/" rel="noopener noreferrer"&gt;Lists with inputs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vue-fluid-dnd.netlify.app/guides/listinputs/" rel="noopener noreferrer"&gt;Custom dragging styles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vue-fluid-dnd.netlify.app/guides/droppableclass/" rel="noopener noreferrer"&gt;Custom hover droppable styles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vue-fluid-dnd.netlify.app/guides/sortingtable/" rel="noopener noreferrer"&gt;Sort rows of the tables&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vue-fluid-dnd.netlify.app/guides/listremove/" rel="noopener noreferrer"&gt;Remove on lists&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Benefits of using Vue Fluid DnD
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Lightweight&lt;/strong&gt;: Vue Fluid DnD has no dependencies, making it into a lightweight, reliable, and robust library as it does not inherit any errors from external dependencies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simple&lt;/strong&gt;: The Vue Fluid DnD API is simple and quite easy to use. It is also flexible for future functionalities and changes that are planned to be added in the future.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Attractive&lt;/strong&gt;: Vue Fluid DnD was conceived to enhance drag and drop functionalities with elegant animations when the elements are moved over the application. More customization in this area is promised in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusions
&lt;/h2&gt;

&lt;p&gt;This article introduces Vue Fluid DnD as an alternative to drag and drop tools in the Vue 3 ecosystem. An example of its usage is provided, and the advantages of this tool are briefly discussed.&lt;br&gt;
If you are interested in supporting the advancement of this project, you can leave a star on the &lt;a href="https://github.com/carlosjorger/vue-fluid-dnd" rel="noopener noreferrer"&gt;repository&lt;/a&gt; or even better, try out Vue Fluid DnD and provide feedback through an &lt;em&gt;issue&lt;/em&gt;, a &lt;em&gt;pull request&lt;/em&gt;, or by writing to my &lt;a href="//rodriguezcuelloc@gmail.com"&gt;personal email&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
      <category>npm</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
