2017-09-06 31 views
1

語義用戶界面有一個很好的方式來將常用大小應用於很多事情,例如,一個按鈕(在語義UI反應):如何設置語義用戶界面下拉大小以匹配按鈕等

<Button size="tiny" /> 

然而下拉,這在許多情況下,看起來就像一個按鈕,放在一排按鈕,不會出現走「大小」參數。

https://react.semantic-ui.com/modules/dropdown

是否有相同尺寸適用於下拉爲如其他元素的好方法連續按鈕? (即不只是擺弄自定義的CSS,而是更易維護)。

+0

要創建的按鈕和下拉鑽機之間大小相同H T ? –

回答

2

我認爲這是,如果你想創建下拉列表,並使用size attribut像按鈕另一組成部分之間的大小相同,你可以把下拉按鈕內:

import React from 'react' 
import { Dropdown, Menu, Button } from 'semantic-ui-react' 

const options = [ 
    { key: 1, text: 'Choice 1', value: 1 }, 
    { key: 2, text: 'Choice 2', value: 2 }, 
    { key: 3, text: 'Choice 3', value: 3 }, 
] 

const DropdownExampleSimple =() => (
    <div> 
    <Button size="tiny" > 
     <Dropdown text='Dropdown' options={options} simple item /> 
    </Button> 
    <Button size="tiny"> 
     This is Button 
    </Button> 
    </div> 
) 

export default DropdownExampleSimple 

這就是結果:

enter image description here

也許可以幫助你,謝謝

+0

看起來像我想要的結果..我會檢查並回來。 – Dan

+0

工作正常。我的下拉菜單中有一個「按鈕」選項,用「簡單的項目」代替,因爲您已經完成了所有操作。 – Dan

相關問題