/** * Created by TonyJiang on 16/8/25. */ import * as React from "react"; import SelectField from "material-ui/SelectField"; import MenuItem from "material-ui/MenuItem"; import {autobind} from "core-decorators"; export class FontFamilyEditor extends React.Component{ static propTypes = { value: React.PropTypes.string, onChange: React.PropTypes.func }; static defaultProps = { value : null, onChange : () => {} }; static SupportFontFamilies = [ { label: "Arial", value: "Arial" }, { label:'Sans Serif', value:'SansSerif' }, { label:'Times', value:'Times' } ]; render(){ const {value} = this.props; const selectStyle = {width:'100%', fontSize:'14px'}; const items = FontFamilyEditor.SupportFontFamilies.map(item => { return ; }); return (
{items}
); } @autobind onChange(event, oldValue, newValue){ const {onChange} = this.props; onChange(newValue); } }