如何开启按钮材料UI中的对话框中,单击

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中的对话框中,单击

回答:

不知道,如果你从你只省略片断他们,但要确保在你有合适的材料UI进口在顶部您的实际代码:

import Dialog from 'material-ui/Dialog'; 

import FlatButton from 'material-ui/FlatButton';

以上是 如何开启按钮材料UI中的对话框中,单击 的全部内容, 来源链接: utcz.com/qa/266673.html

回到顶部