Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@netsells/nuxt-non-pojo

Package Overview
Dependencies
Maintainers
7
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netsells/nuxt-non-pojo

A way to use non-POJO class instances in NuxtJS

latest
npmnpm
Version
1.3.0
Version published
Maintainers
7
Created
Source

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

FAQs

Package last updated on 27 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts