{"id":17995752,"url":"https://github.com/lihongxun945/tiny-vue","last_synced_at":"2025-07-07T20:14:30.476Z","repository":{"id":45894882,"uuid":"106803430","full_name":"lihongxun945/tiny-vue","owner":"lihongxun945","description":"Deadly simple implement of Vuejs2.x","archived":false,"fork":false,"pushed_at":"2020-10-21T08:35:57.000Z","size":352,"stargazers_count":245,"open_issues_count":3,"forks_count":42,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-07T15:51:47.505Z","etag":null,"topics":["learn-vuejs","tiny-vue","vue-source","vuejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lihongxun945.png","metadata":{"files":{"readme":"README.cn.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-13T09:15:33.000Z","updated_at":"2025-03-23T08:36:01.000Z","dependencies_parsed_at":"2022-07-30T11:37:59.838Z","dependency_job_id":null,"html_url":"https://github.com/lihongxun945/tiny-vue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lihongxun945/tiny-vue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lihongxun945%2Ftiny-vue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lihongxun945%2Ftiny-vue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lihongxun945%2Ftiny-vue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lihongxun945%2Ftiny-vue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lihongxun945","download_url":"https://codeload.github.com/lihongxun945/tiny-vue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lihongxun945%2Ftiny-vue/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260609534,"owners_count":23035954,"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":["learn-vuejs","tiny-vue","vue-source","vuejs"],"created_at":"2024-10-29T21:11:10.744Z","updated_at":"2025-06-18T18:34:08.604Z","avatar_url":"https://github.com/lihongxun945.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tiny-vue\n\n## 这是什么\n\n[English README](./README.md)\n\n这里有非常详细的教程，教你怎么写一个自己的tiny-vue [vue1.0源码解析系列](https://github.com/lihongxun945/myblog/labels/vue1.0%E6%BA%90%E7%A0%81%E8%A7%A3%E6%9E%90)\n\n这是一个非常精简的vuejs的实现，主要用来学习vuejs v1.0.28 的源码。\nVuejs 的源码写的好，但是绕来绕去的逻辑以及比较复杂的link回调很容易把新手搞晕，如果你觉得直接上手看vuejs代码比较头疼，可以先尝试看这个项目的源码。\n大部分的生命周期，函数名和vuejs是一样的。但是代码是完全重写的，除了 dep.js 和少量的函数是从vue.js复制来的。\n\n主要实现了两个功能：\n\n1. state: 响应式的数据，实现了对数据的监听，主要由三部分组成： State -\u003e Observer -\u003e Dep -\u003e Watcher\n2. directive: 对directive的支持，可以自己实现不同的directive。主要由三部分组成：Compile -\u003e Directive -\u003e directives/\n\n你可以这样使用：\n\n```\n\u003cdiv id=\"a\"\u003e\n\t\u003cinput v-model=\"message\" /\u003e\n\t\u003cbutton v-on:click=\"increase\"\u003eIncrease\u003c/button\u003e\n\t\u003cp v-text=\"message\"\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003cscript\u003e\n\tnew Vue({\n\t\tel: \"#a\",\n\t\tdata: {\n\t\t\tmessage: 1\n\t\t},\n\t\tmethods: {\n\t\t\tincrease () {\n\t\t\t\tthis.message += 1\n\t\t\t}\n\t\t}\n\t})\n\u003c/script\u003e\n```\n\n## 支持的特性\n\n1. 响应式state.\n2. 内置的指令: `v-on:click`, `v-text`, `v-model`\n3. 双向数据绑定\n4. 更多功能敬请期待...\n\n## 实现原理\n\n![1](./imgs/1.png)\n![2](./imgs/2.png)\n![3](./imgs/3.png)\n![4](./imgs/4.png)\n\n## Build Setup\n\n``` bash\n# install dependencies\nnpm install\n\n# serve with hot reload at localhost:8080\nnpm run dev\n\n# build for production with minification\nnpm run build\n```\n\nFor detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flihongxun945%2Ftiny-vue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flihongxun945%2Ftiny-vue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flihongxun945%2Ftiny-vue/lists"}