Giter Site home page Giter Site logo

mini-vuex's Introduction

mini-vuex

这是一个实现vuex核心的项目

VUEX的构成 vuex是由两部分构成,分别是Store类和install方法
1.Store类:

  • 是vuex的核心,通过传入的vuex基本的配置项(state,mutation...)进行初始化

  • 其中传入的state调用了new Vue里的data配置项,让state的数据和模板进行了双向绑定

  • 由于state和视图进行了绑定,依赖;所以vuex的数据变化时,对应的视图数据也发生改变

2.install方法:

  • 该方法里调用了mixin的混入,在beforeCreate中把store的实例挂载在Vue的原型上,所以vue的实例能访问(this.$store.xxx)

mini-vuex's People

Contributors

zhuominlooper avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.