2017-04-14 53 views
2

我正在使用項目(語義UI反應),我想將圖像設置爲鏈接。但是,我如何引用鏈接網址?語義UI反應物品圖像作爲鏈接

<Item> 
    <Item.Image src={this.props.fileUrl} size='tiny' as='a' /> 
    <Item.Content> 
    </Item.Content> 
</Item> 

如果我在a -container包裹Item.Image,填充得到弄糟...

回答

1

您是在正確的方式,你需要使用Suir河的增強,所有非Item.Image道具會旁路:

<Item.Image 
    as='a' 
    href='http://example.com' 
    src={this.props.fileUrl} 
    size='tiny' 
/> 
+0

它正在工作,但你得到的錯誤'警告:失敗道具類型:道具'包裹'在'圖像'與道具'href'衝突。他們不能一起定義,選擇一個或另一個。? – user3142695

+0

這是一個錯誤,被固定在'0.73.0' –