evas-vue-store-plugin
evas-vue-store-plugin
Vue plugin adding layers of ORM (ModelsStore, Model, Relation, Query), Api (+mocks), Validation (Field validator)
install
npm i evas-vue-store-plugin
Models syntax
import { Post } from './Post.js'
export class User {
setFields() {
return {
id: this.number(),
name: this.string('John Doe'),
hobbies: this.array(this.string(), ['travel', 'games'])
}
}
setRelations() {
return {
posts: this.hasMany(Post, 'user_id', 'id')
}
}
}
Add plugin
const app = createApp(App/** root component */)
.use(EvasVueStorePlugin, {
models: { User, Post }, // models
api: { // api endpoints
user_list: (args, cb) => {
// return data from api
}
}
})
Related Packages
@vuex-orm/core
The Vuex plugin to enable Object-Relational Mapping access to the Vuex Store.
598,633
2,314
@anny.co/vue-jsonapi-orm
Vue + Vuex ORM and client for any json:api server. Highly inspired by Laravel El...
3,832
@vuex-orm/plugin-graphql
Vuex-ORM persistence plugin to sync the store against a GraphQL API.
3,109
224
Version History
| Version | Released | License |
|---|---|---|
| 1.0.5 | CC-BY-4.0 | |
| 1.0.4 | CC-BY-4.0 | |
| 1.0.3 | CC-BY-4.0 | |
| 1.0.2 | CC-BY-4.0 | |
| 1.0.1 | CC-BY-4.0 |