![](/img/trans.png)
[英]Problem using office-ui-fabric Panel with SPFx webpart on modern page
[英]Javascript when adding SPFx webpart in modern site
我試圖弄清楚添加WebPart時如何修改CSS。
想法是使添加的Web部件的背景跨所有列,假設Web部件添加在2列頁面的左列中。 背景將跨所有CanvasZone行。 不僅僅是添加Web部件的列。
更新:
這是我在render方法中的代碼。 我正在使用HelloWebPart來完成一些非常簡單的操作
public render(): void {
this.domElement.innerHTML = `
<div class="${ styles.helloWorld }">
<div class="${ styles.container }">
<div class="${ styles.row }">
<div class="${ styles.column }">
<span class="${ styles.title }">Welcome to SharePoint!</span>
<p class="${ styles.subTitle }">Customize SharePoint experiences using Web Parts.</p>
<p class="${ styles.description }">${escape(this.properties.description)}</p>
<a href="https://aka.ms/spfx" class="${ styles.button }">
<span class="${ styles.label }">Learn some more</span>
</a>
</div>
</div>
</div>
</div>`;
jQuery(function(){
jQuery('.helloWorld_385074c7').closest('div.CanvasZone').css({
'background-color': 'green'
});
});
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.