简体   繁体   English

如何像在 google keep 中一样拖放网格

[英]How to make a grid drag and drop like in google keep

I am trying to accomplish a drag and drop section like in google keep, in vuejs, where every div can be in a different height(all in the same width)我正在尝试完成一个拖放部分,就像在 google keep 中,在 vuejs 中,每个 div 可以有不同的高度(所有的宽度相同)

example例子

Searched google, used a library that didn't work well, nothing like the quality of google keep搜索谷歌,使用了一个效果不佳的库,没有什么比得上谷歌保留的质量

It is possible with jquery UI.可以使用 jquery UI。 It is high quality.它是高质量的。

You just need to include a jquery library and jquery ui library.你只需要包含一个 jquery 库和 jquery ui 库。 Vuejs is more advanced than what you need to do. Vuejs 比你需要做的更高级。

Library links:库链接:

 $( function() { $( "#draggable" ).draggable(); $( "#droppable" ).droppable({ drop: function( event, ui ) { $( this ).addClass( "ui-state-highlight" ).find( "p" ).html( "Dropped;" ); } }); } );
 <script src="https://code.jquery.com/jquery-3.6.0.js"></script> <script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script> <link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css"> <link rel="stylesheet" href="/resources/demos/style.css"> <div id="draggable" class="ui-widget-content"> <p>Drag me to my target</p> </div> <div id="droppable" class="ui-widget-header"> <p>Drop here</p> </div>

Documentation文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM