-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.tsx
49 lines (46 loc) · 1 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import 'react-app-polyfill/ie11';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import RingMenu from '../.';
import { MenuItem } from '../dist/interface';
import '../dist/index.css';
const items: MenuItem[] = [
{
key: '1',
title: '1',
disabled: true,
},
{
key: '2',
title: 'wrap\ntitle\nmenu',
children: [
{
key: '2-1',
title: '2-1',
children: [{ key: '2-1-1', title: '2-1-1' }],
},
],
},
{
key: '3',
title: '3',
children: [
{ key: '3-1', title: '3-1' },
{
key: '3-2',
title: '3-2',
children: [{ key: '3-1-1', title: '3-1-1' }],
},
],
},
];
const App = () => {
return (
<div
style={{ height: 600, border: '1px solid', position: 'relative', backgroundColor: '#ddd' }}
>
<RingMenu items={items} position={{ x: 200, y: 200 }} onClick={item => console.log(item)} />
</div>
);
};
ReactDOM.render(<App />, document.getElementById('root'));