Mithril JavaScript 的 MVC 框架

Mithril.js 是一个客户端的 JavaScript MVC 框架。可将应用分成数据层、UI层和控制层。Mithril 压缩后只有 3kb 左右。API 提供一个模板引擎,带 DOM diff 实现,支持路由和组合。

Mithril

示例代码:

//namespACE
var app = {};
 
//model
app.PageList = Function() {
    return m.request({method: "GET", url: "pages.JSON"});
};
 
//controller
app.controller = function() {
    this.pages = app.PageList();
};
 
//vIEw
app.view = function(ctrl) {
    return ctrl.pages().map(function(page) {
        return m("a", {href: page.url}, page.title);
    });
};
 
//iNitialize
m.module(document.getElementById("example"), app);

性能比较:

Mithril.js 1.1.6 发布,JavaScript MVC 框架
Mithril.js 1.1.6 已发布,更新如下:core: render()函数不再阻止更改 lifecycle hooks 中的 document.activeElement。core: 不再调用从视图返回 null 的子组件的 onremove。hypertext: 正确处理传递给 m()的共享属性对象。在需要的时候复制属性。更多详情可查阅更新日志Mithril.js 是一个客户端的 Java

发布于 2017-12-03 00:21:38 | 90 次阅读

Mithril.js 1.1.4 发布,JavaScript MVC 框架
Mithril.js 1.1.4 发布了,该版本修复了如下bug:Fix IE bug where active element is null causing render function to throw error. (1943)下载地址:Source code (zip)Source code (tar.gz)Mithril.js 是一个客户端的 JavaScript MVC 框架。可将应用分成数据层、UI层和控制层。Mithril 压缩后只有 3kb 左

发布于 2017-09-27 00:18:43 | 165 次阅读

Mithril v0.2.6 和 v0.2.7 发布,JavaScript MVC 框架
Mithril v0.2.6 和 v0.2.7  发布了。Mithril.js 是一个客户端的 JavaScript MVC 框架。可将应用分成数据层、UI层和控制层。Mithril 压缩后只有 3kb 左右。API 提供一个模板引擎,带 DOM diff 实现,支持路由和组合。更新内容请关注发布主页。下载地址:v0.2.6:Source code (zip)Source code (tar.gz)v0.2.7:Source cod

发布于 2017-07-13 00:00:22 | 126 次阅读

Mithril v1.1.2 发布,JavaScript MVC 框架
Mithril v1.1.2 发布了。Mithril.js 是一个客户端的 JavaScript MVC 框架。可将应用分成数据层、UI层和控制层。Mithril 压缩后只有 3kb 左右。API 提供一个模板引擎,带 DOM diff 实现,支持路由和组合。更新内容请关注发布主页。下载地址:mithril.jsmithril.min.jsSource code (zip)Source code (tar.gz)

发布于 2017-07-12 00:27:14 | 112 次阅读

Mithril.js 1.1.1 发布,JavaScript MVC 框架
Mithril.js 1.1.1 是一个 bug 修复版本,更新如下:hyperscript: 允许 0 作为 m()的第二个参数hyperscript: 将 attrs.class 恢复至 v1.0.1 版本的状态文档改进Mithril.js 是一个客户端的 JavaScript MVC 框架。可将应用分成数据层、UI层和控制层。Mithril 压缩后只有 3kb 左右。API 提供一个模板引擎,带 DOM diff

发布于 2017-04-05 00:22:46 | 141 次阅读

Mithril v1.0.0 发布,JavaScript MVC 框架
Mithril v1.0.0 发布了。Mithril.js 是一个客户端的 JavaScript MVC 框架。可将应用分成数据层、UI层和控制层。Mithril 压缩后只有 3kb 左右。API 提供一个模板引擎,带 DOM diff 实现,支持路由和组合。你可查看提交记录了解更新情况。下载地址:Source code (zip)Source code (tar.gz)

发布于 2017-01-31 00:59:35 | 157 次阅读

Mithril 0.2.1 发布,JavaScript MVC 框架
Mithril 0.2.1 发布,此版本更新内容:新特性:large refactor to take better advantage of Chrome js optimizations and improve source code readability (thanks to @isiahmeadows)added catch and finally to promisesimprovements and fixes in the documentation and wikim(component, ...args) can now be used as

发布于 2015-12-20 00:27:26 | 142 次阅读

Mithril.js 0.2.0 发布,JavaScript MVC 框架
Mithril.js 0.2.0 发布,此版本更新内容如下:新特性Mithril modules will be referred to as components from now on.Virtual DOM tree can now contain componentsComponents can now be parameterized via m.component改进m.module 重命名为 m.mountBug 修复fix diff edge case in 发布于 2015-05-01 23:32:23 | 198 次阅读

Mithril.js 0.1.32 发布,JavaScript MVC 框架
Mithril.js 0.1.32 发布,现已提供下载:https://github.com/lhorie/mithril.js/archive/v0.1.32.zip。官方尚未有发行说明,同一天还发布了 Mithril.js 0.1.31 版本,更新内容如下:新特性Typescript definitions are more strongly typedm.request's unwrapSuccess and unwr

发布于 2015-03-28 00:26:05 | 573 次阅读

Mithril.js 0.1.30 发布,JavaScript MVC 框架
Mithril.js 0.1.30 发布,此版本是个维护版本,主要是 bug 修复:fix history.back() regression #435fix module.view's this association regression in Haxe environment #434fix array serialization syntax in querystrings #440 Mithril.js 是一个客户端的 JavaScript MVC 框架。

发布于 2015-02-08 00:51:02 | 213 次阅读

Mithril.js 0.1.29 发布,JavaScript MVC 框架
Mithril.js 0.1.29 发布,现已提供下载(ZIP)。 Mithril.js 是一个客户端的 JavaScript MVC 框架。可将应用分成数据层、UI层和控制层。Mithril 压缩后只有 3kb 左右。API 提供一个模板引擎,带 DOM diff 实现,支持路由和组合。

发布于 2015-01-29 00:20:48 | 146 次阅读

Mithril.js 0.1.28 发布,JavaScript MVC 框架
Mithril.js 0.1.28 发布,此版本现已提供下载,是个维护版本,更新内容如下:新特性性能提升Bug 修复throw error if root element is null in m.module/m.route #388 Mithril.js 是一个客户端的 JavaScript MVC 框架。可将应用分成数据层、UI层和控制层。M

发布于 2015-01-02 00:20:08 | 223 次阅读

Mithril 0.1.22 发布,JavaScript 的 MVC 框架
Mithril 0.1.22 发布,此版本是个维护版本,现已提供下载,更新内容如下:新特性docs now have anchor links for easier navigationthere is more documentation for things that weren't that clearjson-p support addedm() now supports splat for children (e.g. m("div",

发布于 2014-09-28 07:46:49 | 187 次阅读

Mithril 0.1.21 发布,JavaScript 的 MVC 框架
Mithril 0.1.21 发布,此版本是个维护版本,现已提供下载。更新内容如下:新特性:passing a promise to an m.prop now populates it with the resolved value upon resolution, and returns undefined otherwisem.redraw can now be forced to called synchronouslyBug 修复:fixed han

发布于 2014-08-25 00:54:57 | 169 次阅读

Mithril.js 入门介绍
本篇内容为大家讲解的是Mithril.js 入门介绍,感兴趣的同学参考学习下,本文内容如下:

发布于 2015-12-24 11:57:54 | 219 次阅读


Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务