2222
2323### Features
2424
25- * A lightweight, no-dependency
25+ * A lightweight, no-dependency
2626* All props are reactive
2727* Support touch events
2828* Use draggable, resizable or both
@@ -98,7 +98,8 @@ Type: `Boolean`<br>
9898Required: ` false ` <br >
9999Default: ` false `
100100
101- Determines whether the component should be active.
101+ Determines whether the component should be active.
102+ 确定组件是否应处于活动状态。
102103
103104``` html
104105<vue-drag-resize :isActive =" true" >
@@ -112,6 +113,9 @@ Default: `false`
112113Disable behavior of the component by clicking on it and clicking outside the component's area (isActive: true / false).
113114If the prop is enabled, the component is oriented only to the specified.
114115
116+ 通过单击组件并单击组件区域外部来禁用组件的行为(isActive:true / false)。
117+ 如果启用了prop,则组件仅面向指定的。
118+
115119``` html
116120<vue-drag-resize :preventActiveBehavior =" true" >
117121```
@@ -123,7 +127,8 @@ Default: `0`
123127
124128Define the initial width of the parent element. If not specified it calculated automatically.
125129With this parameter, you can set the bounding area for the component, and also it is used when resizing in real time.
126-
130+ 定义父元素的初始宽度。 如果未指定,则自动计算。
131+ 使用此参数,您可以设置组件的边界区域,并在实时调整大小时使用它。
127132``` html
128133<vue-drag-resize :parentW =" 2000" >
129134```
@@ -135,6 +140,8 @@ Default: `0`
135140
136141Define the initial height of the parent element. If not specified it calculated automatically.
137142With this parameter, you can set the bounding area for the component, and also it is used when resizing in real time.
143+ 定义父元素的初始高度。 如果未指定,则自动计算。
144+ 使用此参数,您可以设置组件的边界区域,并在实时调整大小时使用它。
138145
139146``` html
140147<vue-drag-resize :parentH =" 2000" >
@@ -147,7 +154,8 @@ Default: `1`
147154
148155Define the initial horizontal scale or the parent element. Same value in parent's transform: scale() css definition.
149156The drag/resize and the sticks' sizes will computed with this value.
150-
157+ 定义初始水平比例或父元素。父级的transform: scale ()css定义中的值相同。
158+ 拖动/调整大小和杆的大小将使用该值计算。
151159``` html
152160<vue-drag-resize :parentScaleX =" 0.5" >
153161```
@@ -159,6 +167,9 @@ Default: `1`
159167
160168Define the initial vertical scale or the parent element. Same value in parent's transform: scale() css definition.
161169The drag/resize and the sticks' sizes will computed with this value.
170+ 定义初始垂直比例或父元素。父级的transform: scale ()css定义中的值相同。
171+
172+ 拖动/调整大小和杆的大小将使用该值计算。
162173
163174``` html
164175<vue-drag-resize :parentScaleY =" 0.5" >
@@ -170,6 +181,8 @@ Required: `false`<br>
170181Default: ` true `
171182
172183Determines whether the component should draggable.
184+ 确定组件是否应可拖动。
185+
173186
174187``` html
175188<vue-drag-resize :isDraggable =" false" >
@@ -181,53 +194,23 @@ Required: `false`<br>
181194Default: ` true `
182195
183196Determines whether the component should resize.
197+ 确定组件是否应调整大小。
198+
184199
185200``` html
186201<vue-drag-resize :isResizable =" false" >
187202```
188-
189203#### parentLimitation
190204Type: ` Boolean ` <br >
191205Required: ` false ` <br >
192206Default: ` false `
193207
194208Limits the scope of the component's change to its parent size.
209+ 将组件更改的范围限制为其父大小。
195210
196- ``` html
197- <vue-drag-resize :parentLimitation =" true" >
198- ```
199-
200- #### snapToGrid
201- Type: ` Boolean ` <br >
202- Required: ` false ` <br >
203- Default: ` false `
204-
205- Determines whether the component should move and resize in predefined steps.
206-
207- ``` html
208- <vue-drag-resize :snapToGrid =" true" >
209- ```
210-
211- #### gridX
212- Type: ` Number ` <br >
213- Required: ` false ` <br >
214- Default: ` 50 `
215-
216- Define the grid step size for the horizontal axis. Both sides of the component (left and right) will snap to this step.
217-
218- ``` html
219- <vue-drag-resize :snapToGrid =" true" :gridX =" 20" >
220- ```
221-
222- #### gridY
223- Type: ` Number ` <br >
224- Required: ` false ` <br >
225- Default: ` 50 `
226-
227- Define the grid step size for the vertical axis. Both sides of the component (top and bottom) will snap to this step.
228211
229212``` html
230- <vue-drag-resize :snapToGrid =" true" :gridY = " 20 " >
213+ <vue-drag-resize :parentLimitation =" true" >
231214```
232215
233216#### aspectRatio
@@ -236,6 +219,8 @@ Required: `false`<br>
236219Default: ` false `
237220
238221Determines whether the component should retain its proportions.
222+ 确定组件是否应保持其比例。
223+
239224
240225``` html
241226<vue-drag-resize :aspectRatio =" false" >
@@ -247,6 +232,8 @@ Required: `false`<br>
247232Default: ` 200 `
248233
249234Define the initial width of the component.
235+ 定义组件的初始宽度。
236+
250237
251238``` html
252239<vue-drag-resize :w =" 200" >
@@ -258,6 +245,9 @@ Required: `false`<br>
258245Default: ` 200 `
259246
260247Define the initial height of the component.
248+ 定义组件的初始高度。
249+
250+
261251
262252``` html
263253<vue-drag-resize :h =" 200" >
@@ -269,6 +259,9 @@ Required: `false`<br>
269259Default: ` 50 `
270260
271261Define the minimal width of the component.
262+ 定义组件的初始宽度。
263+
264+
272265
273266``` html
274267<vue-drag-resize :minw =" 50" >
@@ -280,6 +273,8 @@ Required: `false`<br>
280273Default: ` 50 `
281274
282275Define the minimal height of the component.
276+ 定义组件的最小高度。
277+
283278
284279``` html
285280<vue-drag-resize :minh =" 50" >
@@ -291,6 +286,8 @@ Required: `false`<br>
291286Default: ` 0 `
292287
293288Define the initial x position of the component.
289+ 定义组件的初始X位置。
290+
294291
295292``` html
296293<vue-drag-resize :x =" 0" >
@@ -302,6 +299,8 @@ Required: `false`<br>
302299Default: ` 0 `
303300
304301Define the initial y position of the component.
302+ 定义组件的初始Y位置。
303+
305304
306305``` html
307306<vue-drag-resize :y =" 0" >
@@ -313,6 +312,7 @@ Required: `false`<br>
313312Default: ` auto `
314313
315314Define the zIndex of the component.
315+ 定义组件的zindex(层级)。
316316
317317``` html
318318<vue-drag-resize :z =" 999" >
@@ -324,6 +324,8 @@ Required: `false`<br>
324324Default: ` ['tl', 'tm', 'tr', 'mr', 'br', 'bm', 'bl', 'ml'] `
325325
326326Define the array of handles to restrict the element resizing:
327+ 定义句柄数组以限制元素大小调整:
328+
327329* ` tl ` - Top left
328330* ` tm ` - Top middle
329331* ` tr ` - Top right
@@ -343,6 +345,7 @@ Required: `false`<br>
343345Default: ` both `
344346
345347Define the axis on which the element is draggable. Available values are ` x ` , ` y ` , ` both ` or ` none ` .
348+ 定义元素可拖动的轴。 可用值为` x ` ,` y ` ,` both ` 或` none ` 。
346349
347350``` html
348351<vue-drag-resize axis =" x" >
@@ -353,6 +356,7 @@ Type: `String`<br>
353356Required: ` false `
354357
355358Defines the selector that should be used to drag the component.
359+ 定义应该用于拖动组件的选择器。
356360
357361``` html
358362<vue-drag-resize dragHandle =" .drag" >
@@ -363,6 +367,7 @@ Type: `String`<br>
363367Required: ` false `
364368
365369Defines a selector that should be used to prevent drag initialization.
370+ 定义应该用于防止拖动初始化的选择器。
366371
367372``` html
368373<vue-drag-resize dragCancel =" .drag" >
@@ -382,6 +387,7 @@ Required: `false`<br>
382387Parameters: ` Original event handler `
383388
384389Called whenever the component gets clicked.
390+ 单击组件时调用。
385391
386392``` html
387393<vue-drag-resize @clicked =" onActivated" >
@@ -393,6 +399,7 @@ Required: `false`<br>
393399Parameters: ` - `
394400
395401Called whenever the component gets clicked, in order to show handles.
402+ 单击组件时调用,以显示句柄。
396403
397404``` html
398405<vue-drag-resize @activated =" onActivated" >
@@ -404,6 +411,8 @@ Required: `false`<br>
404411Parameters: ` - `
405412
406413Called whenever the user clicks anywhere outside the component, in order to deactivate it.
414+ 每当用户单击组件外部的任何位置时调用,以便将其停用。
415+
407416
408417``` html
409418<vue-drag-resize @deactivated =" onDeactivated" >
@@ -413,6 +422,7 @@ Called whenever the user clicks anywhere outside the component, in order to deac
413422
414423Required: ` false ` <br >
415424Parameters: ` object `
425+
416426``` javascript
417427{
418428 left: Number , // the X position of the component
@@ -423,6 +433,8 @@ Parameters: `object`
423433```
424434
425435Called whenever the component gets resized.
436+ 每当组件调整大小时调用。
437+
426438
427439``` html
428440<vue-drag-resize @resizing =" onResizing" >
@@ -442,6 +454,8 @@ Parameters: `object`
442454```
443455
444456Called whenever the component stops getting resized.
457+ 每当组件停止调整大小时调用。
458+
445459
446460``` html
447461<vue-drag-resize @resizestop =" onResizstop" >
@@ -461,6 +475,8 @@ Parameters: `object`
461475```
462476
463477Called whenever the component gets dragged.
478+ 每当拖动组件时调用。
479+
464480
465481``` html
466482<vue-drag-resize @dragging =" onDragging" >
@@ -481,6 +497,8 @@ Parameters: `object`
481497
482498
483499Called whenever the component stops getting dragged.
500+ 每当组件停止拖动时调用。
501+
484502
485503``` html
486504<vue-drag-resize @dragstop =" onDragstop" >
0 commit comments