forked from JimLiu/reactree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
35 lines (34 loc) · 876 Bytes
/
index.js
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
import React from 'react'
import { render } from 'react-dom'
import { default as TreeView } from './src'
import { NormalSource } from './sources'
import DemoDragAndDrop from './DemoDragAndDrop'
import SAMPLE from './sample'
const source1 = new NormalSource(SAMPLE.AB)
const source2 = new NormalSource(SAMPLE.DEEP2)
const dnd = new DemoDragAndDrop()
render(
(
<div style={{
height: '400px'
}}>
<div style={{
height: '100%',
width: '400px',
border: '1px solid red',
display: 'inline-block'
}}>
<TreeView dataSource={source1} dnd={dnd}/>
</div>
<div style={{
height: '100%',
width: '400px',
border: '1px solid red',
display: 'inline-block'
}}>
<TreeView dataSource={source2} dnd={dnd} />
</div>
</div>
),
document.getElementById('root')
)