cklmercer / vue-stash

Easily share reactive data between your Vue components.
MIT License
403 stars 29 forks source link

Vue-stash reactivity not working in data variables #24

Closed gijo-varghese closed 6 years ago

gijo-varghese commented 7 years ago

I'm using Vue-stash as an alternative to vuex. Vue-stash itself is reactive. However, if I use it inside a data variable, that variable isn't changing

<template>
 <div>
  {{id}} // not reactive
 </div>
</template>
<script>
export default {
  data() {
    return {
      id: this.$store.id
    }
  }
}
</script>
gijo-varghese commented 6 years ago

ok. Figured that I've to use computed properties!