forked from libin1991/WrcListInRule
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathIndex.jsx
executable file
·49 lines (45 loc) · 1.27 KB
/
Index.jsx
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, {Component} from 'react';
import {render} from 'react-dom';
import 'react-deltaui/src/components/Delta';
import DuWrap from 'react-deltaui/src/components/DuWrap';
import './reset.css';
import {static_cities} from './city.js'
import WrcListInRule from './WrcListInRule/index.jsx';
// 获取到数据的参数名称
const structure = {
id: 'cityCode',
name: 'cityName'
}
class CityDemo extends Component{
constructor() {
super();
console.log(static_cities)
}
/*
* 城市点击事件
* @param {num} id 当前城市的id
* @param {string} name 当前城市的名称
* @return {void} void返回值
*/
selectCity(id, name) {
console.log(id)
console.log(name)
}
render() {
return (
<div className="du-page-outer">
<div className="du-page-home">
<DuWrap>
<div className="city-select">
<WrcListInRule list={static_cities.cityMap} type={false} selectTurnToPage={this.selectCity} structure={structure} />
</div>
</DuWrap>
</div>
</div>
)
}
}
render(
<CityDemo />,
document.getElementById('du-app')
);