Skip to content

Computed calls

Compare
Choose a tag to compare
@pinguinjkeke pinguinjkeke released this 17 Oct 08:47
· 19 commits to master since this release

Thanks a lot for @dasdeck for great PR.

Now you can bind properties as computed to call them like this:

Vue.use(localStorage, { bind: true })

new Vue({
  localStorage: {
    someValue: {
      default: 6,
      type: Number
    }
  },
  created () {
    this.someValue // 6
    this.somValue = 7 // Will write 7 to localStorage
  }
})

You can use global config bind property like:

Vue.use(localStorage, { bind: true })

or use it for properties you need to be bounded as computed:

new Vue({
  localStorage: {
    someValue: {
      type: Number,
      bind: true
    }
  }
})