2017-01-04 92 views
0

我嘗試從組件orderList中刪除頂部和底部按鈕。 enter image description herePrimeNG OrderList按鈕刪除

我唯一想出的就是使用css。我試圖通過他們的圖標屬性選擇他們,但沒有運氣。

我的CSS這是後primeng css文件加載:

button[icon="fa-angle-double-up"] { 
    display: none; 
} 

button[ng-reflect-icon="fa-angle-double-up"] { 
    display: none; 
} 

我的組件:

@Component({ 
    template: `<p-orderList></p-orderList>`, 
    styles: [` 
     button[icon="fa-angle-double-up"] { 
      display: none; 
     } 
     button[ng-reflect-icon="fa-angle-double-up"] { 
      display: none; 
     } 
    `], 

    encapsulation: ViewEncapsulation.None 
}) 

那麼,有沒有一種另一種方式來刪除這是我想要的按鈕或什麼是通過CSS做到這一點的正確方法?

回答

0

嘗試

button[icon="fa-angle-double-up"] { 
    display: none !important; 
} 

另一種選擇:延長primeng組件,並重新定義HTML模板。

+0

我已經從組件中刪除了'encapsulation'和'styles'選項並將'!important'添加到了css規則中,並且它工作正常。 –