New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@johnnywang/vuex-loader

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@johnnywang/vuex-loader

A tiny plugin for Vuex, handling with normal import

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

vuex-loader

This plugin is a webpack-loader, which could only be set in your webpack condig file, a new runtime compile version has be published

Please refer to: Vuexess

This is a simple webpack loader which helps import vuex data without using any mapState, mapActions...

Install

$ npm install @johnnywang/vuex-loader

then just use right below(which will load before) your webpack's vue-loader:

it will automatically import all the vuex data you want to each components.

module.exports = {
  modules: {
    test: /\.vue$/,
    loader: [
      'vue-loader',
      '@johnnywang/vuex-loader',
    ],
  },
}

Usage

Use vuex option in each vue component:

No matter vuex or Vuex, it is case-insensitive.

export default {
  name: 'SampleComponent',
  vuex: {
    state: ['profile', 'todoList'],
    actions: ['getProfile', 'getTodos'],
    Login: {
      state: ['loginStatus'],
      actions: ['postLogin'],
    }
  },
};

Params in vuex options

moduleName below is the module name which you had registered in your vuex.

this plugin will not check anything, which totally relys on vuex. so totally without any side effect.

ParamTypeDescription
statearray or objectrootState of vuex
gettersarray or objectrootGetters of vuex
mutationsarray or objectrootMutations of vuex
actionsarray or objectrootActions of vuex
moduleNameobjectmodules registered in vuex

License

MIT

Copyright (c) 2020-present, Johnny Wang

FAQs

Package last updated on 20 May 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc