Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

easy-vuex

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-vuex

适用于小型Vue应用的数据管理。可以全局共享部分数据和方法,既不需要像Vuex那样额外写一些mutation,又不需要采用Vue传统的props/events来通讯。

  • 0.2.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

easy-vuex

简介

适用于小型Vue应用的数据管理。可以全局共享部分数据和方法,既不需要像Vuex那样额外写一些mutation,又不需要采用Vue传统的props/events来通讯。

使用示例


Vue.use(require('easy-vuex'), {
    state: {
        foo: 'bar',
    },
    getters: {
        computedFoo () {
            return this.foo + 'hey';
        }
    },
    actions: {
        setFoo () {
            this.foo = 'baz';
            var that = this;
            setTimeout(function () {
            	that.foo = 'bar';
            }, 1000);
        }
    }
});


<div @click="$actions.setFoo">{{ $state.foo }}{{ $getters.computedFoo }}</div>

会作用于全局,js代码里可以通过this.$state等访问数据和方法。

Keywords

FAQs

Package last updated on 13 Dec 2017

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