JSViews--JQuery系的MVVM框架
JSViews
https://github.com/BorisMoore/jsviews
JsViews: next-generation MVVM and MVP framework - bringing templates to life
The power of MVVM, the flexibility of JavaScript, the speed and ease of JsRender templates and jQuery
JsViews builds on top of JsRender templates, and adds data-binding and observable data, to provide a fully-fledged MVVM platform for easily creating interactive data-driven single-page apps and websites.
例子
http://www.jsviews.com/#samples
http://www.jsviews.com/#jsvplaying
<!DOCTYPE html> <!-- To run the current sample code in your own environment, copy this to an html page. --> <html> <head> <script src="//code.jquery.com/jquery-1.12.4.min.js"></script> <base href="//www.jsviews.com/samples/" /> <script src="../download/jsviews.min.js"></script> <link href="samples.css" rel="stylesheet" /> </head> <body> <table><tbody id="peopleList"></tbody></table> <script id="peopleTmpl" type="text/x-jsrender"> <tr><td> <button id="addBtn">Add</button> </td></tr> {^{for people}} <tr><td> {{:name}} </td></tr> {{/for}} </script> <script> var myTemplate = $.templates("#peopleTmpl"); var people = [ { name: "Adriana" }, { name: "Robert" } ]; var app = { people: people }; myTemplate.link("#peopleList", app); $("#addBtn").on("click", function() { $.observable(people).insert({name: "name"}); }); </script> </body> </html>
JSViews API
http://www.jsviews.com/#jsvapi
JsRender and JsViewsJsRender is used for data-driven rendering of templates to strings, ready for insertion in the DOM. (See JsRender Quickstart and JsRender GitHub repository).
JsViews incorporates JsRender templates, together with data-binding, observable data and MVVM support. It provides a powerful platform for building dynamic interactive websites and single-page apps.
(Note: JsRender and JsViews together provide the next-generation implementation of the official jQuery plugins JQuery Templates, and JQuery Data Link – and supersede those libraries.)
评价
http://blchen.com/jsviews-javascript-mvvm-framework/
https://stackoverflow.com/questions/tagged/jsviews (每个问题回答者,只有1或者2个,说明应用不广泛)
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 全网最简单!3分钟用满血DeepSeek R1开发一款AI智能客服,零代码轻松接入微信、公众号、小程
· .NET 10 首个预览版发布,跨平台开发与性能全面提升
· 《HelloGitHub》第 107 期
· 全程使用 AI 从 0 到 1 写了个小工具
· 从文本到图像:SSE 如何助力 AI 内容实时呈现?(Typescript篇)
2017-01-07 LazyMan的Promise解法