项目作者: chiic

项目描述 :
a sortable menu for ngx
高级语言: TypeScript
项目地址: git://github.com/chiic/ngx-vertical-sortable-menu.git
创建时间: 2020-03-17T12:06:59Z
项目社区:https://github.com/chiic/ngx-vertical-sortable-menu

开源协议:

下载


ngx-vertical-sortable-menu

Vertical sorting drag menu based on angular6 +

Overview


Overview

How to use it?

npm i -S ngx-vertical-sortable-menu

Import the NgxVerticalSortableMenuModule in your app.module.ts:

  1. @NgModule({
  2. declarations: [
  3. AppComponent
  4. ],
  5. imports: [
  6. BrowserModule,
  7. AppRoutingModule,
  8. NgxVerticalSortableMenuModule
  9. ],
  10. providers: [],
  11. bootstrap: [AppComponent]
  12. })

Use the NgxVerticalSortableMenuComponent by placing:

  1. <div style="height: 100vh;border-right: 1px solid #cccccc;width: 240px;">
  2. <ngx-vertical-sortable-menu
  3. (closeEmit)="closeEmit($event)"
  4. (clickEmit)="clickEmit($event)"
  5. (menuSort)="menuSort($event)"
  6. [menuList]="menus"
  7. liHeight="40"></ngx-vertical-sortable-menu>
  8. </div>

Demo

demo

API

interface

  • MenuItem:
    1. type iconTy = 'class';
    2. interface MenuItem {
    3. name: string;
    4. url: string;
    5. icon?: string;
    6. id?: string | number;
    7. iconType?: iconTy;
    8. }

Input &Output

Property Description Type Default
[menuList] An array of the MenuItem type MenuItem[] -
[liHeight] Menu line height number -
(clickEmit) Menu click event callback function. EventEmitter -
(closeEmit) Menu close event callback function. EventEmitter -
(menuSort) Returns the current data when dragged and sorted. EventEmitter -