2017-04-05 32 views
1

我正在嘗試Polythene,但它似乎所有文檔都是針對舊版本Mithril。我無法弄清楚如何在當前版本的Mithril上使用這個庫。如何使用聚乙烯與祕銀1.1?

以下是一些基本的代碼,我得到了明顯的工作原理與祕0.2:

import m from "mithril"; 
import button from "polythene/button/button"; 

var app = { 
    view: function() { 
     return m("div", [ 
      m.component(button, { 
       label: "Hello", 
       raised: true 
      }) 
     ]); 
    } 
} 

m.mount(document.body, app); 

這將如何爲當前的祕銀1.1寫?

回答