欢迎光临散文网 会员登陆 & 注册

杨村长pinia源码剖析+手写

2023-03-22 17:04 作者:year一人  | 我要投稿

import { defineStore } from 'pinia'export const useCounterStore = defineStore('counter', {  state: () => {    return { count: 0 }  },  // could also be defined as  // state: () => ({ count: 0 })  getters: {    double: (state) => state.count * 2,  },  actions: {    increment() {      this.count++    },  },})

杨村长pinia源码剖析+手写的评论 (共 条)

分享到微博请遵守国家法律