@netsells/nuxt-non-pojo
A way to use non-POJO class instances in NuxtJS
Last updated 6 months ago by sam.boylett .
ISC · Original npm · Tarball · package.json
$ cnpm install @netsells/nuxt-non-pojo 
SYNC missed versions from official npm registry.

Build Status codecov Mutation testing badge

Nuxt Non-POJO

Use non-POJO objects in NuxtJS with server side rendering.

Usage

Add a plugin:

    plugins: [
        '~/plugins/nuxt-non-pojo',
    ],
// plugins/nuxt-non-pojo.js

import Vue from 'vue';
import createPlugin from '@netsells/nuxt-non-pojo';
import { Foo, Bar } from '../models';

export default createPlugin(Vue, {
    classes: [Foo, Bar],
});

Save an object in data

// With NuxtJS context
app.$nnp.save(foo);

// In a component

this.$nnp.save(foo);

Read an object from data

this.$nnp(foo)

Add a class after plugin registered

this.$nnp.register(Foo);

Current Tags

  • 1.3.0                                ...           latest (6 months ago)

5 Versions

  • 1.3.0                                ...           6 months ago
  • 1.2.0                                ...           6 months ago
  • 1.1.1                                ...           6 months ago
  • 1.1.0                                ...           6 months ago
  • 1.0.0                                ...           6 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |