dystore

1.0.8 • Public • Published

dystore

vue数据仓库

安装

npm install dystore --save

快速开始

  • 安装
import dystore from 'dystore'
let store = {
  test:"123"
}
Vue.use(dystore,store)
  • 数据仓库
let a = this.$store.state.data1
this.$store.state.test = '456'
  • mapState
import { mapState } from 'dystore'

{
  ...,
  computed:{
    ...mapState({
      test:'state.data1'
    })
  },
  ...
}

赋值(可以直接赋值)
this.test='123'
取值
<div>{{ test }}</div> 
  • event-bus
this.$store.$emit('testevent','123')

this.$store.$on('testevent',(res)=>{
    console.log(res)
})
  • chrome调试工具(应用商店搜索dystore)

点击下载

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.8
    0
    • latest

Version History

Package Sidebar

Install

npm i dystore

Weekly Downloads

0

Version

1.0.8

License

ISC

Unpacked Size

20.6 kB

Total Files

4

Last publish

Collaborators

  • mochou