0.2.1 • Published 5 years ago

vue-local-storage-decorator v0.2.1

Weekly downloads
33
License
MIT
Repository
github
Last release
5 years ago

Vue Local Storage Decorator

npm Build Status Coverage CodeFactor Known Vulnerabilities

This library fully depends on vue-class-component.

Description

It persists the component data by using local storage

License

MIT License

Install

npm i -S vue-local-storage-decorator

Usage

// 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<string[]>('dummyData')
  }
}
0.2.1

5 years ago

0.2.0

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.14

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.1

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago