vuex-orm-plugin-date-attribute

Vuex-ORM Plugin to enable date type attributes.
1,461
Install
npm install vuex-orm-plugin-date-attribute
Latest Version:0.1.1
License:MIT
Last Updated:Mar 14, 2019
Links: npm
Maintainer: smnscp

Vuex ORM Plugin: Date Attribute

JavaScript Style Guide License

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

@vuex-orm/plugin-axios

Vuex ORM plugin for adding smooth integration with axios.

123,547 349
huddlebv-plugin-axios

Fork of Vuex ORM plugin for adding smooth integration with axios. Fork is needed...

1,718 349
vuex-orm-json-api

A JSON:API adapter for Vuex ORM.

18,023 21
@vuex-orm/plugin-graphql

Vuex-ORM persistence plugin to sync the store against a GraphQL API.

3,109 224
vuex-orm-localforage

Vuex-ORM Plugin to sync the data against an indexedDB using localforage.

2,013

Version History

Version Released License
0.1.1 MIT
0.1.0 MIT