1.3.2 • Published 4 years ago

simple-context-menu v1.3.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Context menu Component

Install

npm install simple-context-menu

Example

Example Link : Go Code Sandbox

Usage

<!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <title>Title</title>
      <style>
        #target {
          width: 300px;
          height: 300px;
          background-color: #767073;
        }
      </style>
    </head>
    <body>
    <div id="contextMenu"></div>
    <div id="target">target</div>
    <script src="dist/js/bundle.js"></script>
    </body>
    </html>
import ContextMenu from "simple-context-menu";

const dataSource = [{
  title: 'first',
  key: 'first',
},
  {
    title: 'second',
    key: 'second',
    menu: [
      { title: 'second-1', key: 'second-1' },
      { title: 'second-2', key: 'second-2' }
    ]
  },
  {
    title: 'third',
    key: 'third',
    menu: [
      { title: 'third-1', key: 'third-1' },
      { title: 'third-2', key: 'third-2' },
      { title: 'third-3', key: 'third-3' }
    ]
  }
];


const contextMenu = new ContextMenu();
const callBack = (key) => {
  alert( key );
};

const options = {
  delay: 500//delay submenu  
};

contextMenu.register( '#target',
  callBack,
  dataSource,
  options );

Options

propertyDescription
delaydelay submenu

Update

1.3.0

Add Submenu

1.0.0

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago