New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/vip30/vue-local-storage-decorator

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/vip30/vue-local-storage-decorator

  • v0.2.1
  • Source
  • Go
  • Socket score

Version published
Created
Source

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')
  }
}

FAQs

Package last updated on 08 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc