本文整理汇总了TypeScript中mithril.redraw函数的典型用法代码示例。如果您正苦于以下问题:TypeScript redraw函数的具体用法?TypeScript redraw怎么用?TypeScript redraw使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了redraw函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: push
export function push(type, message): void {
const n = { type: type, message: message, timestamp: Date.now() };
notifications.add(n);
m.redraw();
setTimeout(() => {
notifications.delete(n);
m.redraw();
}, 4000);
}
示例2: m
_vnode.dom.onclick = e => {
overlay.open(() => {
return m("textarea.long-text", {
value: text,
cols: 80,
rows: 24,
readonly: "",
oncreate: vnode2 => {
(vnode2.dom as HTMLTextAreaElement).focus();
(vnode2.dom as HTMLTextAreaElement).select();
}
});
});
// prevent index page selection
e.stopPropagation();
m.redraw();
};
示例3: stop
const onDragStart = (
e: MouseEvent & MithrilEvent,
vnode: m.Vnode<HandleAttrs>,
) => {
if (e.button === 0) {
stop(e)
dragStart = {
x: e.clientX,
y: e.clientY,
}
offset = {
...vnode.attrs.userOffset,
}
window.addEventListener('mousemove', onDrag)
window.addEventListener('mouseup', onDragEnd)
m.redraw()
}
}
示例4: setTimeout
setTimeout(() => {
setRequestedSupply(null);
redraw();
}, 1e3);
示例5:
const mousemove = (e2: MouseEvent) => {
this.state.x = Math.max(x + e2.screenX - e1.screenX, 0);
this.state.y = Math.max(y + e2.screenY - e1.screenY, 0);
m.redraw();
};
示例6:
store.fulfill(lastRenderTimestamp, pageVisitTimestamp).then(updated => {
if (updated) m.redraw();
});
示例7:
document.addEventListener("keydown", event => {
if (event.code === "Escape") {
this.setNewGame();
m.redraw();
}
});
示例8: setTimeout
setTimeout(() => {
m.redraw();
console.assert(count === 2);
}, FRAME_BUDGET);
示例9: setTimeout
setTimeout(() => {
notifications.delete(n);
m.redraw();
}, 4000);