本文整理匯總了TypeScript中@stencil/core.QueueApi類的典型用法代碼示例。如果您正苦於以下問題:TypeScript QueueApi類的具體用法?TypeScript QueueApi怎麽用?TypeScript QueueApi使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了QueueApi類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: startStatusTap
export function startStatusTap(win: Window, queue: QueueApi) {
queue.read(() => {
const width = win.innerWidth;
const height = win.innerWidth;
const el = win.document.elementFromPoint(width / 2, height / 2);
if (!el) {
return;
}
const contentEl = el.closest('ion-content');
if (contentEl) {
contentEl.componentOnReady().then(() => {
queue.write(() => {
contentEl.getScrollElement().scrollToTop(300);
});
});
}
});
}
示例2:
queue.read(async () => {
const width = win.innerWidth;
const height = win.innerWidth;
const el = win.document.elementFromPoint(width / 2, height / 2);
if (!el) {
return;
}
const contentEl = el.closest('ion-content');
if (contentEl) {
await contentEl.componentOnReady();
queue.write(() => {
contentEl.getScrollElement().scrollToTop(300);
});
}
});
示例3: as
win.addEventListener('statusTap', () => {
queue.read(() => {
const width = win.innerWidth;
const height = win.innerHeight;
const el = win.document.elementFromPoint(width / 2, height / 2) as (Element | null);
if (!el) {
return;
}
const contentEl = el.closest('ion-content');
if (contentEl) {
contentEl.componentOnReady().then(() => {
queue.write(() => contentEl.scrollToTop(300));
});
}
});
});
示例4:
contentEl.componentOnReady().then(() => {
queue.write(() => contentEl.scrollToTop(300));
});
示例5:
contentEl.componentOnReady().then(() => {
queue.write(() => {
contentEl.getScrollElement().scrollToTop(300);
});
});