<dy-page-loadbar>
A page-level loading progress bar that appears at the top of the page to indicate loading status.
Example
Loading...
<dy-button @click=${()=>{const Loadbar=customElements.get('dy-page-loadbar');Loadbar.start();setTimeout(()=>Loadbar.end(),3000);}}> Show page loader </dy-button>
import { Loadbar } from '@duoyun-fe/duoyun-ui/elements/page-loadbar';
function onClick() {
Loadbar.start();
setTimeout(() => Loadbar.end(), 3000);
}API
Shadow DOM; Extends GemElement
Static Properties
| Property | Type |
|---|---|
instance |
DuoyunPageLoadbarElement | undefined |
timer |
number |
Static Methods
| Method | Type | Description |
|---|---|---|
start |
({ delay }?: { delay?: number; }) => Promise<void> |
在延时时间内结束将不会显示加载条 |
end |
() => Promise<void> |
