@mpxjs/pinia
TypeScript icon, indicating that this package has built-in type declarations

2.10.2 • Public • Published

mpx-pinia

A pinia style store for mpx framework

Usage

app.mpx

import mpx from '@mpxjs/core'
import { createPinia } from '@mpxjs/pinia'

const pinia = createPinia()
mpx.use(pinia)

store.js

import { defineStore } from '@mpxjs/pinia'

// 选项式
export const useOptionsStore = defineStore('options', {
  state: () => {},
  getters: {},
  actions: {}
})

// 组合式
export const useSetupStore = defineStore('setup', () => {
  let storeObj = {
    name: ''
  }
  return {...storeObj} 
})

Readme

Keywords

Package Sidebar

Install

npm i @mpxjs/pinia

Weekly Downloads

126

Version

2.10.2

License

Apache-2.0

Unpacked Size

61.9 kB

Total Files

12

Last publish

Collaborators

  • handsomebingo
  • wangzhikai
  • yixiaoshan
  • valkeriz
  • skyadmin
  • hiyuki
  • commanderxl
  • pagnkelly
  • blackgan3
  • wuxianqiang
  • jvzuojing
  • xbup
  • wangshunnn
  • qiushuibai