{"id":19258945,"url":"https://github.com/lassehaslev/restful-vue","last_synced_at":"2026-06-18T13:31:35.843Z","repository":{"id":89976130,"uuid":"62645214","full_name":"LasseHaslev/restful-vue","owner":"LasseHaslev","description":null,"archived":false,"fork":false,"pushed_at":"2016-07-08T13:52:29.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T18:17:02.658Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/LasseHaslev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-05T14:50:03.000Z","updated_at":"2016-07-05T14:50:19.000Z","dependencies_parsed_at":"2023-05-30T18:00:34.108Z","dependency_job_id":null,"html_url":"https://github.com/LasseHaslev/restful-vue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LasseHaslev/restful-vue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseHaslev%2Frestful-vue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseHaslev%2Frestful-vue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseHaslev%2Frestful-vue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseHaslev%2Frestful-vue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LasseHaslev","download_url":"https://codeload.github.com/LasseHaslev/restful-vue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseHaslev%2Frestful-vue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34493355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-09T19:14:51.064Z","updated_at":"2026-06-18T13:31:35.813Z","avatar_url":"https://github.com/LasseHaslev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @lassehaslev/restful-vue\n\u003e Helpers for showing, update and delete elements\n\n## Install\nRun ```npm install @lassehaslev/restful-vue --save``` in your project folder\n\nThis class contains mixins for making the use of restful apis easier.\n\nWe help you to add new items, update items and remove them from index with simple steps.\n\n## Usage\nTo get any of the mixins just get what you want from the ```@lassehaslev/restful-vue```\n``` js\nimport Vue from 'vue'\n\n// Install plugin and dependencies\nimport RestfulVue from '@lassehaslev/restful-vue';\nVue.use( RestfulVue );\n\n// Import everything\nimport { container, create, update, remove } from '@lassehaslev/restful-vue'\n\n// If you only want the container\nimport { container } from '@lassehaslev/restful-vue'\n```\n\n#### Container\nThe container mixin is to handle list of items and index. This is also where we add newly created models, and remove them on delete.\n\nThe container is also the home of the objects that uses the [Create mixin](###Create ) and [Edit mixin](###Edit).\n``` html\n\u003ctemplate\u003e\n    \u003cupdate v-for=\"model in models\" :url=\"'/api/update/' + model.id\" :model=\"model\"\u003e\u003c/update\u003e\n    \u003ccreate url=\"/api/store\"\u003e\u003c/create\u003e\n\u003c/template\u003e\n\u003cscript\u003e\n    import { container } from '@lassehaslev/restful-vue'\n    module.exports = {\n\n        mixins: [ container ],\n\n        components: {\n            Create,\n            Edit,\n        }\n\n    }\n\u003c/script\u003e\n```\n\n#### Create\nCreate is the mixin thats create an elements an push it in to the container\n``` html\n\u003ctemplate\u003e\n    \u003cbutton @click=\"create\" class=\"add\"\u003eCreate\u003c/button\u003e\n\u003c/template\u003e\n\u003cscript\u003e\n    import { create } from '@lassehaslev/restful-vue'\n    module.exports = {\n        mixins: [ create ],\n    }\n\u003c/script\u003e\n```\n\n#### Update and Delete\nThe update mixin is for updating items. When updated the new items goes into the container index list. \n\nThe Delete sends out that the item should be deleted and it gets removed from the container.\n``` html\n\u003ctemplate\u003e\n    \u003cdiv\u003e\n        \u003cform @submit=\"update\"\u003e\n            \u003cinput id=\"\" type=\"text\" v-model=\"model.name\"\u003e\n            \u003cbutton type=\"submit\"\u003eUpdate\u003c/button\u003e\n        \u003c/form\u003e\n        \u003cspan @click=\"delete\"\u003eX\u003c/span\u003e\n    \u003c/div\u003e\n\u003c/template\u003e\n\u003cscript\u003e\n    import { update, remove } from '@lassehaslev/restful-vue'\n    module.exports = {\n        mixins: [ update, remove ],\n    }\n\u003c/script\u003e\n```\n\n## Development\n``` bash\n# install dependencies\nnpm install\n\n# serve with hot reload at localhost:8080\nnpm run dev\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flassehaslev%2Frestful-vue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flassehaslev%2Frestful-vue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flassehaslev%2Frestful-vue/lists"}