2016-09-08 69 views
1

所以我有一個文本需要在popover中顯示。我有以下代碼,使文本顯示在一行中。我需要包裝文本,讓他們在多行,但用戶理由,但到目前爲止,我的更新還沒有成功。任何想法?如何在材質UI中對文本進行文字包裝。

      <Popover 
           anchorEl={target} 
           open={open} 
           anchorOrigin={{horizontal: 'middle', vertical: 'bottom'}} 
           targetOrigin={{horizontal: 'left', vertical: 'bottom'}} 
           onRequestClose={handleRequestClose} 
           animation={PopoverAnimationVertical}> 
           <Menu 
            autoWidth={true} 
            > 
            <MenuItem style={{width: "200px", height: "200px"}}> 
             <p style={{display: "flex", flexWrap: "wrap"}}>'aslkjflajdsljflskdjflsdfjlsjdfjdfjlasjkfadlsf'</p> 
            </MenuItem> //this does not work.... 
           </Menu> 

回答

3

嘗試重置whiteSpace風格 -

<MenuItem style={{whiteSpace: 'normal'}}> 
    <p>This song is just six words long. This song is just six words long. This song is just six words long. This song is just six words long.</p> 
</MenuItem> 
+0

這一切正常。謝謝! :) – Abhas