1.3.0 • Published 4 years ago

@netsells/nuxt-non-pojo v1.3.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

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);
1.3.0

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago