pinia基本使用,vue3
这是我们需要从pinia中获取storeToRefs方法。将store包起来,要注意不能结构方法出来,方法仍需要从store中直接解构,当然,我们也可以直接使用 store.属性名 或 store.方法名 直接使用。Pinia中的 getters 直接使用 computed函数 进行模拟, 组件中需要使用需要把 getters return出去。官方文档:https://prazdevs.github.io/pinia-plugin-persistedstate/zh/
原创
2023-10-29 17:50:38 ·
128 阅读 ·
0 评论