1
export default class Help extends Component {
componentWillMount(){
this.state = {open:false};
}
handleOpen() {
this.setState({open: true});
}
handleClose() {
this.setState({open: false});
}
render() {
const actions = [
<FlatButton
label="Cancel"
primary={true}
onTouchTap={this.handleClose}
/>,
<FlatButton
label="Submit"
primary={true}
keyboardFocused={true}
onTouchTap={this.handleClose}
/>,
];
return (
<div className="container-fluid">
<button type="button" className="btn btn-primary active" id="Hlp" onTouchTap={this.handleOpen}>Help</button>
<Dialog
title="Dialog With Actions"
actions={actions}
modal={false}
open={this.state.open}
onRequestClose={this.handleClose}
>
The actions in this window were passed in as an array of React objects.
</Dialog>
</div>
);
}
}
我已經使用材料的UI的按鈕,點擊打開一個對話框,現在我看到控制檯中的一個錯誤,說無法讀取屬性「prepareStyles」的undefined..I可以看到按鈕在屏幕上如何開啓按鈕材料UI中的對話框中,單擊
我沒有包括importa,但它肯定那些進口是出品者 – LOKI
好的。在你最上面的組件(或其他父組件)中,你是否按照說明打包了MuiThemeProvider? http://www.material-ui.com/#/get-started/usage –
添加muitheremprovider後,現在它工作正常.....感謝 – LOKI