import React from 'react';
import ReactDOM from 'react-dom';
class List extends React.Component {
constructor(props) {
super(props)
this.state = {
citys: ['上海', '北京', '南京']
}
}
render() {
let citys = this.state.citys.map(city => {
return <li key={city}>{city}</li>
})
return (<div>
<ul>
{citys}
</ul>
</div>)
}
changeValue(event) {
console.log('event', event);
this.setState({
inputValue: event.target.value
});
}
}
ReactDOM.render(
<List />,
document.getElementById('root')
);
10-11
855
11-26
322