{"id":19580754,"url":"https://github.com/warriorbrian/vue-save-storage","last_synced_at":"2025-02-26T12:16:01.704Z","repository":{"id":97197052,"uuid":"182246674","full_name":"warriorBrian/vue-save-storage","owner":"warriorBrian","description":"Common storage package","archived":false,"fork":false,"pushed_at":"2019-04-19T10:56:23.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-15T17:30:50.863Z","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/warriorBrian.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-19T10:18:02.000Z","updated_at":"2019-04-19T10:57:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"87303a4c-4070-425d-b534-3a3dc63a9c70","html_url":"https://github.com/warriorBrian/vue-save-storage","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"9154969b5181bbcfa737d35c3e5d2e7780616ea7"},"previous_names":["warriorbrian/vue-save-stroage"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warriorBrian%2Fvue-save-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warriorBrian%2Fvue-save-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warriorBrian%2Fvue-save-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warriorBrian%2Fvue-save-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/warriorBrian","download_url":"https://codeload.github.com/warriorBrian/vue-save-storage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240849054,"owners_count":19867617,"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-11-11T07:29:28.874Z","updated_at":"2025-02-26T12:16:01.634Z","avatar_url":"https://github.com/warriorBrian.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-save-storage\n\n\u003chr /\u003e\n\n## Install\n\n```bash\nnpm install --save vue-save-storage\n```\n\n## Usage\n\n```js\nimport Vue from 'vue'\nimport storage from 'vue-save-storage'\n// 默认引入为localstorage\nVue.prototype.$storage = storage\n```\n\n```js\nimport Vue from 'vue'\nimport {local, session} from 'vue-save-storage'\n// localstorage, session\nVue.prototype.$local = local\nVue.prototype.$session = session\n```\n\n### Nuxt.js\n\n可以在Nuxt.js中使用`vue-save-storage`。\n\n`vue-save-storage`必须作为NuxtJS插件包含在内：\n\n```javascript\n// nuxt.config.js\nplugins: [{ src: '~/plugins/storage.js', ssr: false }]\n```\n\n## API\n\n### `localStorage and sessionStorage`\n\n- `setItem(key, value\u003cany\u003e)`: value可以为对象、数组或者基本类型\n- `getItem(key\u003cstring\u003e)`: 获取localStorage或者sessionStorage中设置的值。\n- `remove(key\u003cstring\u003e)`: 移除localStorage或者sessionStorage中某一个值\n- `clear()`: 移除localStorage或者sessionStorage中所有的值\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarriorbrian%2Fvue-save-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwarriorbrian%2Fvue-save-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarriorbrian%2Fvue-save-storage/lists"}