2016-11-12 53 views
1

我想要實現這樣的事情,我搜索了這裏之前:語義ui使內容div可滾動但不是整個頁面可滾動? (流星+反應)

jsfiddle.net/psychomachine/03pfvhzs/1/

但結果我得到我的應用程序是這樣的:

http://i.imgur.com/S4wbKp9.png

這是所呈現的代碼:

//App.js 
render() { 
return <div className="main2"> 
    {/*HEADER (NAVIGATION + CONTEXT BAR)*/} 
    <Navigation /> 
    {/*CONTENT*/} 
    <div className="pusher">{ this.props.children }</div> 
</div>; 
}, 

示例代碼去在內容DIV,即「推」

<div className="ui main text container"> 
    <h3>Page Two</h3> 
    <h3>Page Two</h3> 
    <h3>Page Two</h3> 
    <h3>Page Two</h3> 
    <h3>Page Two</h3> 
    <h3>Page Two</h3> 
    <h3>Page Two</h3> 
    <h3>Page Two</h3> 
    <h3>Page Two</h3> 
    <h3>Page Two</h3> 
    <h3>Page Two</h3> 
..... // This goes on for another 20 times, just to get scrolling to show 
</div> 

和菜單欄的股利,也就是在渲染:

<div className="ui top attached demo inverted menu"> 
Rest of the code is at: http://semantic-ui.com/examples/fixed.html 
If you view the page source, since it will be too cluttered to put in here 

是沒可能反應做,由於它如何呈現的東西?

這真的讓我感到困擾,但如果無法完成,哦,生病了,必須忍受頁面不一致,因爲沒有滾動內容的頁面沒有滾動條,而那些滾動條會有滾動條將所有東西都推向左邊一點

回答

0

它與Meteor或React無關,只需要將推送器包裝在可推出的標籤類中,就像這樣。

<div class="ui bottom attached segment pushable"> 
    <div class="pusher"> 
    <div class="ui main text container"> 
     <h3>Page Two</h3> 
     <h3>Page Two</h3> 
     <h3>Page Two</h3> 
     <h3>Page Two</h3> 
     <h3>Page Two</h3> 
     <h3>Page Two</h3> 
     <h3>Page Two</h3> 
     <h3>Page Two</h3> 
     <h3>Page Two</h3> 
     <h3>Page Two</h3> 
    </div> 
    </div> 
</div> 
0

你只需要包裝在可推類:

<div class="ui top attached demo inverted menu"> 
    <div class="pusher"> 
    <div class="ui main text container"> 
     <h3>Page Two</h3> 
     <h3>Page Two</h3> 
     <h3>....</h3> 
    </div> 
    </div> 
</div>