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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何讓Material-UI輸入字段填充工具欄

如何讓Material-UI輸入字段填充工具欄

湖上湖 2023-10-24 16:59:41
我正在努力讓 Material-ui 應(yīng)用程序欄示例按照我的意愿工作。Codesandbox(來自 Material-UI 網(wǎng)站)。我想要實現(xiàn)的目標:我想要實現(xiàn)的目標是讓搜索字段一直向右增長(無論屏幕尺寸如何,都有效地占據(jù)了應(yīng)用程序欄的大部分)。我嘗試過的:我嘗試使用flexGrow: 1如下方法,只會稍微增加搜索欄(直到最后):search: {  position: 'relative',  borderRadius: theme.shape.borderRadius,  backgroundColor: fade(theme.palette.common.white, 0.15),  '&:hover': {    backgroundColor: fade(theme.palette.common.white, 0.25),},marginRight: theme.spacing(2),marginLeft: 0,width: '100%',[theme.breakpoints.up('sm')]: {  marginLeft: theme.spacing(3),  width: 'auto',  flexGrow:1},}我也嘗試過設(shè)置width: '100%'而不是,'width: auto'但這會使 Material-UI 徽標消失。期望結(jié)果的圖像:
查看完整描述

1 回答

?
收到一只叮咚

TA貢獻1821條經(jīng)驗 獲得超5個贊

width: 'auto'從當前代碼中刪除


添加minWidth標題


title: {

  display: 'none',

  minWidth: '120px',                 // Add

  [theme.breakpoints.up('sm')]: {

    display: 'block',

  },

},

search: {

  position: 'relative',

  borderRadius: theme.shape.borderRadius,

  backgroundColor: fade(theme.palette.common.white, 0.15),

  '&:hover': {

    backgroundColor: fade(theme.palette.common.white, 0.25),

  },

  marginRight: theme.spacing(2),

  marginLeft: 0,

  width: '100%',                     // Keep

  [theme.breakpoints.up('sm')]: {

    marginLeft: theme.spacing(3),

    // width: 'auto',                // Remove

  },

},

https://img1.sycdn.imooc.com/653787c200010d9206530178.jpg

查看完整回答
反對 回復(fù) 2023-10-24
  • 1 回答
  • 0 關(guān)注
  • 133 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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