33
44<p align =" center " >
55
6- [ ![ Latest Version on NPM] ( https://img.shields.io/npm/v/vue-drag-resize.svg?style=flat-square )] ( https://npmjs.com/package/vue-drag-resize )
7- [ ![ Software License] ( https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square )] ( LICENSE.md )
8- [ ![ npm] ( https://img.shields.io/npm/dt/vue-drag-resize.svg?style=flat-square )] ( https://www.npmjs.com/package/vue-drag-resize )
6+ [ ![ Latest Version on NPM] ( https://img.shields.io/npm/v/vue-drag-resize.svg?style=flat-square )] ( https://npmjs.com/package/vue-drag-resize )
7+ [ ![ Software License] ( https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square )] ( LICENSE.md )
8+ [ ![ npm] ( https://img.shields.io/npm/dt/vue-drag-resize.svg?style=flat-square )] ( https://www.npmjs.com/package/vue-drag-resize )
99</p >
1010
1111<p align =" center " >
3131
3232### Features
3333
34- * A lightweight, no-dependency
34+ * A lightweight, no-dependency
3535* All props are reactive
3636* Support touch events
3737* Snap element to custom grid
4343
4444## Install and basic usage
4545
46- For Vue2:
4746``` bash
4847$ npm i -s vue-drag-resize
4948```
50- For Vue3:
51- ``` bash
52- $ npm i -s vue-drag-resize@next
53- ```
49+
5450
5551Register the component:
5652
@@ -112,7 +108,8 @@ Type: `Boolean`<br>
112108Required: ` false ` <br >
113109Default: ` false `
114110
115- Determines whether the component should be active.
111+ Determines whether the component should be active.
112+
116113确定组件是否应处于活动状态。
117114
118115``` html
@@ -124,10 +121,10 @@ Type: `Boolean`<br>
124121Required: ` false ` <br >
125122Default: ` false `
126123
127- Disable behavior of the component by clicking on it and clicking outside the component's area (isActive: true / false).
124+ Disable behavior of the component by clicking on it and clicking outside the component's area (isActive: true / false).< br >
128125If the prop is enabled, the component is oriented only to the specified.
129126
130- 通过单击组件并单击组件区域外部来禁用组件的行为(isActive:true / false)。
127+ 通过单击组件并单击组件区域外部来禁用组件的行为(isActive:true / false)。< br >
131128如果启用了prop,则组件仅面向指定的。
132129
133130``` html
@@ -139,9 +136,10 @@ Type: `Number`<br>
139136Required: ` false ` <br >
140137Default: ` 0 `
141138
142- Define the initial width of the parent element. If not specified it calculated automatically.
139+ Define the initial width of the parent element. If not specified it calculated automatically.< br >
143140With this parameter, you can set the bounding area for the component, and also it is used when resizing in real time.
144- 定义父元素的初始宽度。 如果未指定,则自动计算。
141+
142+ 定义父元素的初始宽度。 如果未指定,则自动计算。<br >
145143使用此参数,您可以设置组件的边界区域,并在实时调整大小时使用它。
146144``` html
147145<vue-drag-resize :parentW =" 2000" >
@@ -152,8 +150,9 @@ Type: `Number`<br>
152150Required: ` false ` <br >
153151Default: ` 0 `
154152
155- Define the initial height of the parent element. If not specified it calculated automatically.
153+ Define the initial height of the parent element. If not specified it calculated automatically.< br >
156154With this parameter, you can set the bounding area for the component, and also it is used when resizing in real time.
155+
157156定义父元素的初始高度。 如果未指定,则自动计算。
158157使用此参数,您可以设置组件的边界区域,并在实时调整大小时使用它。
159158
@@ -166,9 +165,10 @@ Type: `Number`<br>
166165Required: ` false ` <br >
167166Default: ` 1 `
168167
169- Define the initial horizontal scale or the parent element. Same value in parent's transform: scale() css definition.
168+ Define the initial horizontal scale or the parent element. Same value in parent's transform: scale() css definition.< br >
170169The drag/resize and the sticks' sizes will computed with this value.
171- 定义初始水平比例或父元素。父级的transform: scale ()css定义中的值相同。
170+
171+ 定义初始水平比例或父元素。父级的transform: scale ()css定义中的值相同。<br >
172172拖动/调整大小和杆的大小将使用该值计算。
173173``` html
174174<vue-drag-resize :parentScaleX =" 0.5" >
@@ -179,10 +179,10 @@ Type: `Number`<br>
179179Required: ` false ` <br >
180180Default: ` 1 `
181181
182- Define the initial vertical scale or the parent element. Same value in parent's transform: scale() css definition.
182+ Define the initial vertical scale or the parent element. Same value in parent's transform: scale() css definition.< br >
183183The drag/resize and the sticks' sizes will computed with this value.
184- 定义初始垂直比例或父元素。父级的transform: scale ()css定义中的值相同。
185184
185+ 定义初始垂直比例或父元素。父级的transform: scale ()css定义中的值相同。<br >
186186拖动/调整大小和杆的大小将使用该值计算。
187187
188188``` html
@@ -195,6 +195,7 @@ Required: `false`<br>
195195Default: ` true `
196196
197197Determines whether the component should draggable.
198+
198199确定组件是否应可拖动。
199200
200201
@@ -208,6 +209,7 @@ Required: `false`<br>
208209Default: ` true `
209210
210211Determines whether the component should resize.
212+
211213确定组件是否应调整大小。
212214
213215
@@ -220,6 +222,7 @@ Required: `false`<br>
220222Default: ` false `
221223
222224Limits the scope of the component's change to its parent size.
225+
223226将组件更改的范围限制为其父大小。
224227
225228
@@ -259,13 +262,14 @@ Define the grid step size for the vertical axis. Both sides of the component (to
259262``` html
260263<vue-drag-resize :snapToGrid =" true" :gridY =" 20" >
261264```
262-
265+
263266#### aspectRatio
264267Type: ` Boolean ` <br >
265268Required: ` false ` <br >
266269Default: ` false `
267270
268271Determines whether the component should retain its proportions.
272+
269273确定组件是否应保持其比例。
270274
271275
@@ -274,11 +278,14 @@ Determines whether the component should retain its proportions.
274278```
275279
276280#### w
277- Type: ` Number ` <br >
281+ Type: ` Number|String ` <br >
278282Required: ` false ` <br >
279283Default: ` 200 `
280284
281- Define the initial width of the component.
285+ Define the initial width of the component.<br >
286+ The value can either be a number >= 0 or the string 'auto'. <br >
287+ If set to 'auto', the initial width value will be equal to the width of the content within the component.
288+
282289定义组件的初始宽度。
283290
284291
@@ -287,11 +294,14 @@ Define the initial width of the component.
287294```
288295
289296#### h
290- Type: ` Number ` <br >
297+ Type: ` Number|String ` <br >
291298Required: ` false ` <br >
292299Default: ` 200 `
293300
294- Define the initial height of the component.
301+ Define the initial height of the component.<br >
302+ The value can either be a number >= 0 or the string 'auto'. <br >
303+ If set to 'auto', the initial height value will be equal to the height of the content within the component.
304+
295305定义组件的初始高度。
296306
297307
@@ -306,6 +316,7 @@ Required: `false`<br>
306316Default: ` 50 `
307317
308318Define the minimal width of the component.
319+
309320定义组件的初始宽度。
310321
311322
@@ -320,6 +331,7 @@ Required: `false`<br>
320331Default: ` 50 `
321332
322333Define the minimal height of the component.
334+
323335定义组件的最小高度。
324336
325337
@@ -333,6 +345,7 @@ Required: `false`<br>
333345Default: ` 0 `
334346
335347Define the initial x position of the component.
348+
336349定义组件的初始X位置。
337350
338351
@@ -346,6 +359,7 @@ Required: `false`<br>
346359Default: ` 0 `
347360
348361Define the initial y position of the component.
362+
349363定义组件的初始Y位置。
350364
351365
@@ -359,6 +373,7 @@ Required: `false`<br>
359373Default: ` auto `
360374
361375Define the zIndex of the component.
376+
362377定义组件的zindex(层级)。
363378
364379``` html
@@ -382,6 +397,7 @@ Required: `false`<br>
382397Default: ` ['tl', 'tm', 'tr', 'mr', 'br', 'bm', 'bl', 'ml'] `
383398
384399Define the array of handles to restrict the element resizing:
400+
385401定义句柄数组以限制元素大小调整:
386402
387403* ` tl ` - Top left
@@ -403,6 +419,7 @@ Required: `false`<br>
403419Default: ` both `
404420
405421Define the axis on which the element is draggable. Available values are ` x ` , ` y ` , ` both ` or ` none ` .
422+
406423定义元素可拖动的轴。 可用值为` x ` ,` y ` ,` both ` 或` none ` 。
407424
408425``` html
@@ -414,6 +431,7 @@ Type: `String`<br>
414431Required: ` false `
415432
416433Defines the selector that should be used to drag the component.
434+
417435定义应该用于拖动组件的选择器。
418436
419437``` html
@@ -425,6 +443,7 @@ Type: `String`<br>
425443Required: ` false `
426444
427445Defines a selector that should be used to prevent drag initialization.
446+
428447定义应该用于防止拖动初始化的选择器。
429448
430449``` html
@@ -454,6 +473,7 @@ Required: `false`<br>
454473Parameters: ` Original event handler `
455474
456475Called whenever the component gets clicked.
476+
457477单击组件时调用。
458478
459479``` html
@@ -466,6 +486,7 @@ Required: `false`<br>
466486Parameters: ` - `
467487
468488Called whenever the component gets clicked, in order to show handles.
489+
469490单击组件时调用,以显示句柄。
470491
471492``` html
@@ -478,6 +499,7 @@ Required: `false`<br>
478499Parameters: ` - `
479500
480501Called whenever the user clicks anywhere outside the component, in order to deactivate it.
502+
481503每当用户单击组件外部的任何位置时调用,以便将其停用。
482504
483505
@@ -500,6 +522,7 @@ Parameters: `object`
500522```
501523
502524Called whenever the component gets resized.
525+
503526每当组件调整大小时调用。
504527
505528
@@ -521,6 +544,7 @@ Parameters: `object`
521544```
522545
523546Called whenever the component stops getting resized.
547+
524548每当组件停止调整大小时调用。
525549
526550
@@ -542,6 +566,7 @@ Parameters: `object`
542566```
543567
544568Called whenever the component gets dragged.
569+
545570每当拖动组件时调用。
546571
547572
@@ -564,6 +589,7 @@ Parameters: `object`
564589
565590
566591Called whenever the component stops getting dragged.
592+
567593每当组件停止拖动时调用。
568594
569595
@@ -586,4 +612,4 @@ npm run build
586612
587613## License
588614
589- [ MIT license] ( LICENSE )
615+ [ MIT license] ( LICENSE )
0 commit comments