本文整理汇总了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);
});
});