Dans cet article, nous allons voir comment faire pour cacher l’en-tête de votre Lightning App Page à l’aide de CSS et d’un composant Lightning Web Component (LWC)
Pour commencer, nous allons créer une static ressource “RemoveHeader” contenant le code CSS suivant :
Code CSS : removeHeader.css
Et dans le fichier JavaScript du composant LWC , nous allons insérer le code suivant :
Code JS : composantTest.js
import {LightningElement} from ‘lwc’;
//On importe notre fichier CSS depuis la static ressource
import removeHeader from ‘@salesforce/resourceUrl/RemoveHeader’;
//Import loadStyle-Method
import {loadStyle} from ‘lightning/platformResourceLoader’;
export default class LwcComposantTest extends LightningElement {
connectedCallback() {
loadStyle(this, removeHeader )
.then(result => {});
}
}
Pour terminer, nous allons glisser-déposer notre composant LWC sur la Lightning App Page
Voilà !
Nous espérons que cela vous sera utile pour vos prochaines Lightning App et partagez vos idées dans les commentaires.
Biscuit | Durée | La description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |