1.5.1 • Published 7 years ago

vue-cache-data v1.5.1

Weekly downloads
30
License
MIT
Repository
github
Last release
7 years ago

vue-cache-data

VueCacheData provides reactive cache data and fetched until first access

Install

npm install vue-cache-data --save

Usage

<div id="demo">
  <h1>vue cache</h1>
  <ul>
    <li v-for="stock in stockList">{{ stock }}</li>
  </ul>
</div>
import Vue from 'vue'
import VueCacheData from 'vue-cache-data'

Vue.use(VueCacheData)

let AppCache = new VueCacheData()

AppCache.add('stockList', () => ['NJ', 'JX'], function (onSucc, onFail) {
  setTimeout(function () {
    return onSucc(['BJ', 'SH', 'SZ', 'GZ'])
  }, 3000)
})

AppCache.init()

new Vue ({
  el: '#demo',
  computed: {
    stockList () {
      return AppCache.vm.stockList
    }
  }
})
1.5.1

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

8 years ago