{"id":13814588,"url":"https://github.com/thx/bisheng","last_synced_at":"2025-12-12T03:41:17.514Z","repository":{"id":12170492,"uuid":"14768725","full_name":"thx/bisheng","owner":"thx","description":"BI-Directional / Two-Way Data-Binding Library","archived":true,"fork":false,"pushed_at":"2015-01-19T10:56:47.000Z","size":3935,"stargazers_count":68,"open_issues_count":7,"forks_count":21,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-10T22:57:58.610Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://bishengjs.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-28T05:35:00.000Z","updated_at":"2024-11-15T19:04:57.000Z","dependencies_parsed_at":"2022-08-31T03:01:49.463Z","dependency_job_id":null,"html_url":"https://github.com/thx/bisheng","commit_stats":null,"previous_names":["nuysoft/bisheng"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thx%2Fbisheng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thx%2Fbisheng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thx%2Fbisheng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thx%2Fbisheng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thx","download_url":"https://codeload.github.com/thx/bisheng/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254266522,"owners_count":22042123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T04:02:20.287Z","updated_at":"2025-10-22T21:03:39.930Z","avatar_url":"https://github.com/thx.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003e #不推荐继续使用，请移步 [brix-bisheng](https://github.com/nuysoft/brix-bisheng)。\n\nBiSheng.js（毕昇）\n====\n\n[![Build Status](https://api.travis-ci.org/thx/bisheng.png?branch=master)](http://travis-ci.org/thx/bisheng)\n[![GitHub version](https://badge.fury.io/gh/thx%2Fbisheng.png)](http://badge.fury.io/gh/thx%2Fbisheng)\n[![Bower version](https://badge.fury.io/bo/bishengjs.png)](http://badge.fury.io/bo/bishengjs)\n[![Views in the last 24 hours](https://sourcegraph.com/api/repos/github.com/thx/bisheng/counters/views-24h.png)](https://github.com/thx/bisheng/)\n[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)\n\n\u003c!-- BI-Directional / Two-Way Data-Binding with JavaScript. --\u003e\n\n纯粹的数据双向绑定库。\n\nBiSheng.js 的名称源自活字印刷术的发明者“[毕昇]”。因为单向绑定犹如“刻版印刷”，双向绑定犹如“活字印刷”，故名 BiSheng.js。\n\n[毕昇]: http://baike.baidu.com/subview/33366/11034585.htm?fromtitle=%E6%AF%95%E5%8D%87\u0026fromid=64860\u0026type=syn\n\n## API \u0026 文档\n\n* [BiSheng](doc/bisheng.md)\n* [简介](doc/what.md)\n* [工作原理](doc/how.md)\n\n## 快速开始\n\n1. 下载 BiSheng.js\n\n        bower install bishengjs\n\n2. 引入 BiSheng.js\n\n        \u003cscript src=\"./bower_components/bishengjs/dist/bisheng.js\"\u003e\u003c/script\u003e\n\n3. 使用\n\n        // HTML 模板\n        var tpl = '{{title}}'\n        // 数据对象\n        var data = {\n          title: 'foo'\n        }\n        // 执行双向绑定\n        BiSheng.bind(data, tpl, function(content){\n          // 然后在回调函数中将绑定后的 DOM 元素插入文档中\n          $('div.container').append(content)\n        });\n        // 改变数据 data.title，对应的文档区域会更新\n        data.title = 'bar'\n\n## 目录\n\n**代码的结构**按照职责来设计，见下表；**打包后的文件**在 [dist/] 目录下；**API 和文档**在 [doc/] 目录下；**测试用例**在 [test/] 目录下，基本覆盖了目前已实现的功能。\n\n源文件            | 职责 \u0026 功能\n----------------- | -------------------------------------\n[src/ast.js]      | 修改语法树，插入定位符。\n[src/bisheng.js]  | 双向绑定的入口。\n[src/expose.js]   | 模块化，适配主流加载器。\n[src/flush.js]    | 更新 DOM 元素。\n[src/html.js]     | 转换 HTML 字符串为 DOM 元素。\n[src/locator.js]  | 生成定位符，解析、更新定位符的属性。\n[src/loop.js]     | 数据属性监听工具。\n[src/scan.js]     | 扫描 DOM 元素，解析定位符。\n\n[src/ast.js]: https://github.com/thx/bisheng/tree/master/src/ast.js\n[src/bisheng.js]: https://github.com/thx/bisheng/tree/master/src/bisheng.js\n[src/expose.js]: https://github.com/thx/bisheng/tree/master/src/expose.js\n[src/flush.js]: https://github.com/thx/bisheng/tree/master/src/flush.js\n[src/html.js]: https://github.com/thx/bisheng/tree/master/src/html.js\n[src/locator.js]: https://github.com/thx/bisheng/tree/master/src/locator.js\n[src/loop.js]: https://github.com/thx/bisheng/tree/master/src/loop.js\n[src/scan.js]: https://github.com/thx/bisheng/tree/master/src/scan.js\n\n[dist/]: https://github.com/thx/bisheng/tree/master/dist/\n[doc/]: https://github.com/thx/bisheng/tree/master/doc/\n[test/]: https://github.com/thx/bisheng/tree/master/test/\n\n## 更多演示\n\n    grunt \n\n访问 \u003chttp://localhost:5000/\u003e。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthx%2Fbisheng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthx%2Fbisheng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthx%2Fbisheng/lists"}