本文整理匯總了TypeScript中@angular/cdk/drag-drop.moveItemInArray函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript moveItemInArray函數的具體用法?TypeScript moveItemInArray怎麽用?TypeScript moveItemInArray使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了moveItemInArray函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: onDrop
onDrop(event: CdkDragDrop<string[]>) {
if (event.previousIndex === event.currentIndex) {
return;
}
moveItemInArray(this.sectionsList, event.previousIndex, event.currentIndex);
this.store.dispatch(new ReOrderSiteSectionsAction(event.previousIndex, event.currentIndex));
}
示例2: onRankOptionDropped
/**
* Reorders the list on dragging the Rank options.
*/
onRankOptionDropped(event: CdkDragDrop<string[]>): void {
const newOptions: string[] = this.model.options.slice();
moveItemInArray(newOptions, event.previousIndex, event.currentIndex);
this.triggerModelChange('options', newOptions);
}
示例3: drop
public drop(event: CdkDragDrop<Array<unknown>>): void {
const ingredients = this.getCurrentIngredients();
moveItemInArray(ingredients, event.previousIndex, event.currentIndex);
}