當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript mithril.redraw函數代碼示例

本文整理匯總了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);
}
開發者ID:zaidka,項目名稱:genieacs,代碼行數:9,代碼來源:notifications.ts

示例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();
 };
開發者ID:zaidka,項目名稱:genieacs,代碼行數:17,代碼來源:long-text-component.ts

示例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()
   }
 }
開發者ID:FallenMax,項目名稱:smart-toc,代碼行數:18,代碼來源:handle.ts

示例4: setTimeout

 setTimeout(() => {
   setRequestedSupply(null);
   redraw();
 }, 1e3);
開發者ID:vdsabev,項目名稱:betahaus-sofia-office-manager,代碼行數:4,代碼來源:index.ts

示例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();
 };
開發者ID:phincallahan,項目名稱:personal-website,代碼行數:5,代碼來源:Window.ts

示例6:

 store.fulfill(lastRenderTimestamp, pageVisitTimestamp).then(updated => {
   if (updated) m.redraw();
 });
開發者ID:zaidka,項目名稱:genieacs,代碼行數:3,代碼來源:app.ts

示例7:

 document.addEventListener("keydown", event => {
   if (event.code === "Escape") {
     this.setNewGame();
     m.redraw();
   }
 });
開發者ID:ghiobi,項目名稱:dogetictactoe,代碼行數:6,代碼來源:game.component.ts

示例8: setTimeout

	setTimeout(() => {
		m.redraw();
		console.assert(count === 2);
	}, FRAME_BUDGET);
開發者ID:Crevil,項目名稱:DefinitelyTyped,代碼行數:4,代碼來源:test-api.ts

示例9: setTimeout

 setTimeout(() => {
   notifications.delete(n);
   m.redraw();
 }, 4000);
開發者ID:zaidka,項目名稱:genieacs,代碼行數:4,代碼來源:notifications.ts


注:本文中的mithril.redraw函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。