Skip to content

Commit ebffdaf

Browse files
committed
chore: 增加关闭遮罩逻辑
1 parent 4a13f14 commit ebffdaf

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/components/BootstrapBlazor.UniverSheet/Components/UniverSheet.razor.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export async function init(id, invoke, options) {
1919
const { theme, lang, plugins, data, ribbonType, darkMode } = options;
2020
const univerSheet = {
2121
el: el.querySelector('.bb-univer-sheet-wrap'),
22+
backdrop,
2223
invoke,
2324
data,
2425
plugins,
@@ -38,17 +39,25 @@ export async function init(id, invoke, options) {
3839
await createUniverSheetAsync(univerSheet);
3940
Data.set(id, univerSheet);
4041

42+
invoke.invokeMethodAsync('TriggerReadyAsync');
43+
4144
registerBootstrapBlazorModule('UniverSheet', id, () => {
4245
EventHandler.on(document, 'changed.bb.theme', updateTheme);
4346
});
44-
45-
invoke.invokeMethodAsync('TriggerReadyAsync');
4647
}
4748

4849
export function execute(id, data) {
4950
const univerSheet = Data.get(id);
5051

51-
return univerSheet.pushData(data);
52+
const { firstPush, backdrop, pushData } = univerSheet;
53+
if (pushData) {
54+
pushData(data);
55+
}
56+
if (firstPush === true && backdrop) {
57+
setTimeout(() => {
58+
backdrop.classList.add('d-none');
59+
}, 100);
60+
}
5261
}
5362

5463
export function dispose(id) {

src/components/BootstrapBlazor.UniverSheet/wwwroot/data-service.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ export default class DataService {
44
static name = 'DataService';
55

66
registerUniverSheet(sheet) {
7+
sheet.firstPush = true;
78
sheet.pushData = data => {
9+
sheet.firstPush = false;
810
this._checkReceiveDataCallback();
911
return this._callback(data);
1012
};

0 commit comments

Comments
 (0)