javascript - 如何将聚乙烯与 Mithril 1.1 一起使用?

标签 javascript mithril.js

我正在尝试 Polythene但似乎所有文档都是针对旧版本的 Mithril 。我不知道如何在当前版本的 Mithril 中使用这个库。

以下是我得到的一些基本代码,显然可以与 Mithril 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);

对于当前的 Mithril 1.1,这将如何编写?

最佳答案

这是针对特定库的支持请求,因此您可能应该查看存储库。

这里有一个与 Mithril 1 版本相关的未决问题:https://github.com/ArthurClemens/polythene/issues/38

Polythene has reached version 1 and now supports Mithril v1!

关于javascript - 如何将聚乙烯与 Mithril 1.1 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43220864/

相关文章:

javascript - 将叠加层的内容放在中间

javascript - 如何在 localStorage 的 mirthril.js 中存储状态?

javascript - 无法从 miithril View 启动灯箱

javascript - Mithril 不会自动重绘 View

javascript - 每次都需要我们的应用程序模块在控制台中进行调试的替代方案

javascript - IE 中 SCRIPT1003 错误

javascript - JavaScript 中的重定向

javascript - Jenkins 描述

javascript - 编译导入其他js文件的LiveScript

javascript - 如何在 Mithril 中使用 m.request 对模型进行单元测试?