vuex-orm-plugin-date-attribute
Vuex ORM Plugin: Date Attribute
Installation
import VuexORM from '@vuex-orm/core'
import datePlugin from 'vuex-orm-plugin-date-attribute'
VuexORM.use(datePlugin)
Usage in Model Definition
// models/User.js
import { Model } from '@vuex-orm/core'
export default class User extends Model {
static entity = 'users'
static fields () {
return {
id: this.increment(),
name: this.string(''),
active: this.boolean(false),
// Use plugged-in attribute creator Model.date() to create a field whose value will be a Date object.
last_login: this.date(null),
login_count: this.number(0),
}
}
}
Related Packages
huddlebv-plugin-axios
Fork of Vuex ORM plugin for adding smooth integration with axios. Fork is needed...
1,718
349
@vuex-orm/plugin-graphql
Vuex-ORM persistence plugin to sync the store against a GraphQL API.
3,109
224
Version History
| Version | Released | License |
|---|---|---|
| 0.1.1 | MIT | |
| 0.1.0 | MIT |