Blame view

public/assets/libs/Sortable/plugins/OnSpill/README.md 1.21 KB
2db47680   hexiaodong   chore: 初始提交 php 遗...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
  # OnSpill Plugins
  This file contains two seperate plugins, RemoveOnSpill and RevertOnSpill. They can be imported individually, or the default export (an array of both plugins) can be passed to `Sortable.mount` as well.
  
  **These plugins are default plugins, and are included in the default UMD and ESM builds of Sortable**
  
  
  ---
  
  
  ### Mounting
  ```js
  import { Sortable, OnSpill } from 'sortablejs/modular/sortable.core.esm';
  
  Sortable.mount(OnSpill);
  ```
  
  
  ---
  
  
  ## RevertOnSpill Plugin
  This plugin, when enabled, will cause the dragged item to be reverted to it's original position if it is spilled (ie. it is dropped outside of a valid Sortable drop target)
  
  
  
  
  ### Options
  
  ```js
  new Sortable(el, {
  	revertOnSpill: true, // Enable plugin
  	// Called when item is spilled
  	onSpill: function(/**Event*/evt) {
  		evt.item // The spilled item
  	}
  });
  ```
  
  
  ---
  
  
  ## RemoveOnSpill Plugin
  This plugin, when enabled, will cause the dragged item to be removed from the DOM if it is spilled (ie. it is dropped outside of a valid Sortable drop target)
  
  
  ---
  
  
  ### Options
  
  ```js
  new Sortable(el, {
  	removeOnSpill: true, // Enable plugin
  	// Called when item is spilled
  	onSpill: function(/**Event*/evt) {
  		evt.item // The spilled item
  	}
  });
  ```