2016-11-20 62 views

回答

2

我不確定你到底想要做什麼。但根據doc。您可以使用屬性footerModal定製頁腳。

而你只需要將它們都設置爲null而不顯示這兩個按鈕。 (和刪除onOkonCancel屬性,如果你不需要他們了。)

這裏是一個演示:http://codepen.io/andretw/pen/JbEmRO

<Modal 
    visible={this.state.visible} 
    title="Title" 
    //onOk={this.handleOk} 
    //onCancel={this.handleCancel} 
    footer={[ 
    null, 
    null, 
    ]} 
>Test For No TWO buttons on the footer.</Modal> 

如果你想要做Login並通過點擊一個按鈕來關閉模態,你也可以查看我上面寫的演示。

<Modal 
    visible={this.state.visible} 
    title="Title" 
    footer={[ 
    null, null, 
    ]} 
> 
    <div> 
    Test For No TWO buttons on the footer. 
    </div> 
    <div> 
    <Button type="ghost" onClick={this.handleClick}>Login</Button> 
    </div> 
</Modal> 
+0

謝謝你這樣做!你救了我的一天! – soulmachine

+0

不客氣。 –

0

您可以通過footer={null}

+0

謝謝。隨着邊框一起移除頁腳。真棒! – mike123