加载数据时显示动效。
在表格等容器中加载数据时显示。
import { BeTable, BeTableColumn } from '@brewer/beerui'
import {loading} from '$lib/utils/loading'
const load = true
const tableData = [{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄'
}, {
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄'
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄'
}]
<div use:loading={load}>
<BeTable data={tableData}>
<BeTableColumn prop="name" label="姓名" />
<BeTableColumn prop="date" label="日期" />
<BeTableColumn prop="address" label="地址" />
</BeTable>
</div>
调用 loadingSerive
function showLoading() {
let loadingInstance1 = new loadingSerive({
target: 'body',
text: 'loading'
// background: 'rgba(0, 0, 0, 0.8)'
});
loadingInstance1.show();
setTimeout(() => {
loadingInstance1.close();
}, 5000);
}
<BeButton class='demo-button' size="normal" type="primary" on:click={showLoading}>默认按钮</BeButton>