js: update beforeDragging & add itemCanDrag

This commit is contained in:
王劲鹏
2022-08-26 14:16:12 +08:00
committed by osborn
parent 3a28941c04
commit 13c151a9e4
13 changed files with 144 additions and 9 deletions

View File

@@ -87,8 +87,19 @@ export class FlowLayout extends Superview {
@Property
canDrag?: boolean
/**
* @param from
* @returns Returns the item of index which can dragged or not.
*/
@Property
beforeDragging?: (from: number) => void
itemCanDrag?: (from: number) => boolean
/**
* @param from
* @returns Returns an array of index which can not be swap during dragging.
*/
@Property
beforeDragging?: (from: number) => (Array<number> | void)
@Property
onDragging?: (from: number, to: number) => void

View File

@@ -84,8 +84,19 @@ export class HorizontalList extends Superview {
@Property
canDrag?: boolean
/**
* @param from
* @returns Returns the item of index which can dragged or not.
*/
@Property
itemCanDrag?: (from: number) => boolean
/**
* @param from
* @returns Returns an array of index which can not be swap during dragging.
*/
@Property
beforeDragging?: (from: number) => void
beforeDragging?: (from: number) => (Array<number> | void)
@Property
onDragging?: (from: number, to: number) => void

View File

@@ -84,8 +84,19 @@ export class List extends Superview {
@Property
canDrag?: boolean
/**
* @param from
* @returns Returns the item of index which can dragged or not.
*/
@Property
itemCanDrag?: (from: number) => boolean
/**
* @param from
* @returns Returns an array of index which can not be swap during dragging.
*/
@Property
beforeDragging?: (from: number) => void
beforeDragging?: (from: number) => (Array<number> | void)
@Property
onDragging?: (from: number, to: number) => void