When do you need to use a frontend skeleton screen? It is mainly used when the homepage has not fully loaded yet. You can display a skeleton screen first to avoid a blank screen, which would otherwise create a poor user experience. So how do you implement it? You need to configure Dps.config.js as shown below.
In the configuration, the url field is the address of the page for which you want to generate the skeleton screen. You can even use a website like Baidu (https://baidu.com) for testing. The output field defines where the skeleton screen will be generated. The filepath specifies the page where the skeleton screen will be saved, usually the entry page of your project. The injectSelector specifies the DOM node where the skeleton screen will be injected.
The includeElement option allows you to customize or exclude certain nodes during rendering. You can target nodes by id, or check the tagName and define how they should be rendered. The init function runs before generating the skeleton screen and can be used to remove interfering elements.
Basic Configuration Field Description
1 | const dpsConfig = { |