Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vip30/vue-local-storage-decorator
local storage decorator and helper function in Vue
https://github.com/vip30/vue-local-storage-decorator
Last synced: about 2 months ago
JSON representation
local storage decorator and helper function in Vue
- Host: GitHub
- URL: https://github.com/vip30/vue-local-storage-decorator
- Owner: vip30
- License: mit
- Created: 2018-05-21T02:29:29.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-08T04:10:16.000Z (over 5 years ago)
- Last Synced: 2024-01-25T18:47:41.616Z (5 months ago)
- Language: TypeScript
- Size: 73.2 KB
- Stars: 19
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-vue - vue-local-storage-decorator - Persist data by using local stoarge in decorator format (Components & Libraries / Utilities)
- awesome-vue - vue-local-storage-decorator - Persist data by using local stoarge in decorator format (Components & Libraries / Utilities)
- awesome-vue - vue-local-storage-decorator - Persist data by using local storage in decorator format (Components & Libraries / Utilities)
- awesome-vue - vue-local-storage-decorator - Persist data by using local stoarge in decorator format (Components & Libraries / Utilities)
- awesome-vue - vue-local-storage-decorator - Persist data by using local stoarge in decorator format (Components & Libraries / Utilities)
- awesome-vue - vue-local-storage-decorator - Persist data by using local stoarge in decorator format (Components & Libraries / Utilities)
- awesome-vue - vue-local-storage-decorator - Persist data by using local stoarge in decorator format (Components & Libraries / Utilities)
- awesome-vue - vue-local-storage-decorator - Persist data by using local stoarge in decorator format (Components & Libraries / Utilities)
- awesome-vue - vue-local-storage-decorator - Persist data by using local stoarge in decorator format (Components & Libraries / Utilities)
- awesome-vue - vue-local-storage-decorator - local storage decorator and helper function in Vue ` 📝 2 years ago` (Utilities [🔝](#readme))
- awesome-vue - vue-local-storage-decorator - Persist data by using local stoarge in decorator format (Utilities / Typescript)
- awesome-vue - vue-local-storage-decorator - Persist data by using local stoarge in decorator format (Utilities / Typescript)
- awesome-vue - vue-local-storage-decorator ★12 - Persist data by using local stoarge in decorator format (Utilities / Typescript)
- awesome-vue - vue-local-storage-decorator - Persist data by using local stoarge in decorator format (Components & Libraries / Utilities)
README
# Vue Local Storage Decorator
[![npm](https://img.shields.io/npm/v/vue-local-storage-decorator.svg)](https://www.npmjs.com/package/vue-local-storage-decorator)
[![Build Status](https://travis-ci.com/vip30/vue-local-storage-decorator.svg?branch=master)](https://travis-ci.com/vip30/vue-local-storage-decorator)
[![Coverage](https://codecov.io/gh/vip30/vue-local-storage-decorator/branch/master/graph/badge.svg)](https://codecov.io/gh/vip30/vue-local-storage-decorator)
[![CodeFactor](https://www.codefactor.io/repository/github/vip30/vue-local-storage-decorator/badge/master)](https://www.codefactor.io/repository/github/vip30/vue-local-storage-decorator/overview/master)
[![Known Vulnerabilities](https://snyk.io/test/github/vip30/vue-local-storage-decorator/badge.svg)](https://snyk.io/test/github/vip30/vue-local-storage-decorator)This library fully depends on [vue-class-component](https://github.com/vuejs/vue-class-component).
## Description
It persists the component data by using local storage
## License
MIT License
## Install
```bash
npm i -S vue-local-storage-decorator
```## Usage
```typescript
// In main.ts
import VueLocalStorageDecorator from 'vue-local-storage-decorator'
Vue.use(VueLocalStorageDecorator)// In component
import { Persist } from 'vue-local-storage-decorator'
@Component({
// It will use the component name to persist the data
name: 'dummy'
})
export class DummyComponent extends Vue {
// It will save in the local storage while the data is changed and will auto resume from local storage in created lifecycle
@Persist()
public dummyData: string[] = []public saveDummy() {
// You can also call it manually
this.persistData('dummyData')// You can get the data by calling getPersistData
this.dummyData = this.getPersistData('dummyData')
}
}```