第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

react.js antd模態(tài)錯(cuò)誤行為

react.js antd模態(tài)錯(cuò)誤行為

慕運(yùn)維8079593 2021-03-29 15:11:17
因此,我有一個(gè)很大的凌亂組件,我將嘗試縮小它的體積,但是請(qǐng)保留其中大部分,因?yàn)槲也淮_定此時(shí)可能是什么原因。問(wèn)題是游戲可以按預(yù)期運(yùn)行。是時(shí)候渲染模態(tài)了,它出現(xiàn)在頁(yè)面的左下角,沒(méi)有樣式浮在左邊。但是,該功能可以正常工作,按鈕可以正常工作,并且可以顯示原始內(nèi)容。import { Modal } from 'antd';//rest of importsconst initialState = {  visible: false,  streak: 0,  score: 0,  turn: 0,  previousPicks: [],  result: { result: "", player: "", computer: "" }};class Game extends React.Component {  constructor(props) {    super(props);    this.turnLimit = 10;    this.state = initialState;  }  componentWillUnmount() {    this.setState(initialState)  }  updateScore = () => {    //handles score  }  updatePreviousPicks = () => {    //update game data  }  onClickHandler = async (choice) => {    //fetching data from backend           self.showModal();  }  getAIResult = () => {    //  }  showModal = () => {    if (this.state.turn === 10) {      this.setState({        visible: true,      });    }  }  handleOk = () => {    this.setState(initialState)  }  handleCancel = () => {    this.setState(initialState)  }  render() {    return (      <div>        <div>        <Modal          title="Basic Modal"          centered={true}          visible={this.state.visible}          onOk={this.handleOk}          onCancel={this.handleCancel}></Modal>          </div>        <div className="container">          <div id="rockDiv" className={`choice`} onClick={() => this.onClickHandler("rock")}>            <Choices choice="rock"></Choices>          </div>          <div id="paperDiv" className={`choice`} onClick={() => this.onClickHandler("paper")}>            <Choices choice="paper"></Choices>          </div>          <div id="scissorsDiv" className={`choice`} onClick={() => this.onClickHandler("scissors")}>            <Choices choice="scissors"></Choices>        </div>      </div>    )  }}export default Game我試過(guò)從組件中刪除所有CSS,但是模態(tài)不顯示為默認(rèn)的antd設(shè)計(jì)嗎?
查看完整描述

2 回答

?
回首憶惘然

TA貢獻(xiàn)1847條經(jīng)驗(yàn) 獲得超11個(gè)贊

<Modal

          title="Basic Modal"

          centered="true"

          visible={this.state.visible}

          onOk={this.handleOk}

          onCancel={this.handleCancel}></Modal>

您不需要"true"在此處包裝括號(hào),因?yàn)槟鷽](méi)有調(diào)用變量。


查看完整回答
反對(duì) 回復(fù) 2021-04-08
  • 2 回答
  • 0 關(guān)注
  • 195 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)