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

2.9.31 • 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

61

Version

2.9.31

License

Apache-2.0

Unpacked Size

61.9 kB

Total Files

12

Last publish

Collaborators

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