vuex-connect-layer

1.0.1 • Public • Published

vuex-connect-layer

Using vuex with connect

Build Setup

##install

npm i vuex-connect-layer

将业务功能细分为容器组件与视图组件,同时改变vuex的使用方法,自动将store的state commit mutation action映射到 视图组件上 ###.container

import connector from 'vuex-connect-layer'
import connectViewList from '../components/connectViewList.vue'
import store from '../vuex/index.js'
const mapProps = {
  mapStateToProps: {
    comments: state => state.comments
  },
  mapDispatchToProps: {
    fetch: 'fetchComments'
  }
}
const h = connector.connect(mapProps, store)(connectViewList)
export default h

###use in view components

<connect-container type="这是prop"></connect-container>

Readme

Keywords

Package Sidebar

Install

npm i vuex-connect-layer

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

21.4 kB

Total Files

9

Last publish

Collaborators

  • ytftianwen