diff --git a/components/modal/demo/basic.md b/components/modal/demo/basic.md index 1c034fb118..ea75bd061a 100644 --- a/components/modal/demo/basic.md +++ b/components/modal/demo/basic.md @@ -26,12 +26,6 @@ var Test = React.createClass({ visible: false }); }, - handleCancel() { - console.log('点击了取消'); - this.setState({ - visible: false - }); - }, render() { return
diff --git a/components/modal/demo/custom.md b/components/modal/demo/custom.md index 0d5c13e1c2..08848efce1 100644 --- a/components/modal/demo/custom.md +++ b/components/modal/demo/custom.md @@ -34,9 +34,6 @@ var Test = React.createClass({ }, handleCancel() { console.log('点击了取消'); - this.setState({ - visible: false - }); }, render() { return
diff --git a/components/modal/index.jsx b/components/modal/index.jsx index 5d5d8d8d1a..6099dc79cc 100644 --- a/components/modal/index.jsx +++ b/components/modal/index.jsx @@ -12,8 +12,7 @@ export default React.createClass({ }, handleCancel() { - var d = this.refs.d; - d.requestClose(); + this.refs.d.requestClose(); }, getDefaultProps() {