{"id":13536449,"url":"https://github.com/hql123/vue-ruby-china","last_synced_at":"2025-04-02T03:30:45.722Z","repository":{"id":215851370,"uuid":"80791434","full_name":"hql123/vue-ruby-china","owner":"hql123","description":"使用Vue.js框架搭建的ruby china山寨版，集成vue-router+vuex等","archived":false,"fork":false,"pushed_at":"2017-02-08T10:42:25.000Z","size":1073,"stargazers_count":110,"open_issues_count":0,"forks_count":26,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-03T01:33:13.240Z","etag":null,"topics":["ruby-china","vue-resource","vue-router","vue-router-sync","vue2","vuex"],"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/hql123.png","metadata":{"files":{"readme":"README.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-02-03T02:48:54.000Z","updated_at":"2024-08-30T19:50:10.000Z","dependencies_parsed_at":"2024-01-18T06:12:42.417Z","dependency_job_id":null,"html_url":"https://github.com/hql123/vue-ruby-china","commit_stats":null,"previous_names":["hql123/vue-ruby-china"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hql123%2Fvue-ruby-china","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hql123%2Fvue-ruby-china/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hql123%2Fvue-ruby-china/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hql123%2Fvue-ruby-china/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hql123","download_url":"https://codeload.github.com/hql123/vue-ruby-china/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246750853,"owners_count":20827792,"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":["ruby-china","vue-resource","vue-router","vue-router-sync","vue2","vuex"],"created_at":"2024-08-01T09:00:39.593Z","updated_at":"2025-04-02T03:30:45.438Z","avatar_url":"https://github.com/hql123.png","language":"JavaScript","funding_links":[],"categories":["Demo示例"],"sub_categories":[],"readme":"# Vue Ruby China\n\n\u003e Ruby China 山寨版 （Vue框架）\n\n## Demo\n\nhttps://hql123.github.io/\n\n## 项目简介\n\n这个项目还是以Ruby China为范本搭建的模仿平台，Vue.js框架+Bootstrap框架开发，集成vue-cli + vuex + vue-router + vue-resource，大概还会尝试加入服务端渲染的SSR。这个项目我个人觉得挺适合Vuex的初学者尝试的，功能简单逻辑也不复杂，对于actions、 getters、mutations、modules的单向数据流模式应该都使用得挺清晰的。\n\n## 关于项目目录\n\n当初写 React 的 Ruby China 山寨版的时候有人提出了 components 是UI组件，功能主要是可复用，纯粹的渲染组件，尽量不掺杂vuex或redux的使用到这里面，我深以为然！于是在这个项目里面可以看到 components 里面所有的组件都是单纯的渲染可复用组件，在 views 的组件里面定义好 vuex 的 state 通过 props 传过去使用，这是一个好习惯呀！\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# run unit tests\nnpm run unit\n\n# run e2e tests\nnpm run e2e\n\n# run all tests\nnpm test\n```\n\n## nginx配置\n\n```bash\nhttp {\n  include       mime.types;\n  default_type  application/octet-stream;\n  server {\n    listen       9000;\n    server_name  ruby-china.local;\n    root ../ruby-china/dist/; //项目根目录\n    index index.html;\n    location ^~ /static/ {\n     gzip_static on;\n     expires max;\n     add_header Cache-Control public;\n    }\n    location / {\n       try_files $uri $uri/ /index.html;\n    }\n    location /api/v3{\n        proxy_pass https://ruby-china.org/api/v3;\n        proxy_redirect off;\n        proxy_buffering off;\n    }\n  }\n}\n```\n\n##Vuex数据流\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"700px\" src=\"https://raw.githubusercontent.com/vuejs/vuex/dev/docs/en/images/vuex.png\"\u003e\n\u003c/p\u003e\n\n## 参考文献\n\n[Vue.js官方GitHub](https://github.com/vuejs)\n\n[Vue.js](https://cn.vuejs.org/)\n\n[Vuex](https://vuex.vuejs.org/zh-cn/)\n\n[vue-router 2](https://router.vuejs.org/zh-cn/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhql123%2Fvue-ruby-china","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhql123%2Fvue-ruby-china","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhql123%2Fvue-ruby-china/lists"}