分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > IT知识

JSViews--JQuery系的MVVM框架

发布时间:2023-09-06 01:34责任编辑:傅花花关键词:暂无标签

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 JsViews

JsRender 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.)

Topics:
Data-linked template syntax
Template tags
Render and link a template
Building apps
Top-level data-linking
Views: from UI to data
Targets for data-linking
Settings
Advanced

评价

http://blchen.com/jsviews-javascript-mvvm-framework/

https://stackoverflow.com/questions/tagged/jsviews (每个问题回答者,只有1或者2个,说明应用不广泛)

JSViews--JQuery系的MVVM框架

原文地址:https://www.cnblogs.com/lightsong/p/8232841.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved