Provides bindings for js-data Collection
instances to Vue.js view models.
Note: This works only with [email protected]
Install:
npm i -S vue-js-data
Usage:
import Vue from 'vue'
import VueData from 'vue-js-data'
import JSData from 'js-data'
Vue.use(VueData, JSData)
const myCollection = new JSData.Collection([{
id: 1,
title: 'Hello world.'
}, {
id: 2,
title: 'Hello there!'
}])
new Vue({
data: {
myItems: myCollection
},
template: `
<ul>
<li v-for="item in myItems">{{item.id}} has a title: {{item.title}}</li>
</ul>
`
})