pinia
发表于|更新于
|浏览量:
天时不如地利,地利不如人和——孟子
分享一个Vuex的同类型vue状态管理框架:Pinia
中文文档:https://pinia.web3doc.top/

它的Demo:https://stackblitz.com/github/piniajs/example-vue-3-vite?file=README.md
相比于Vuex:https://pinia.web3doc.top/introduction.html#%E4%B8%8E-vuex-%E7%9A%84%E6%AF%94%E8%BE%83
Pinia 提供了一个更简单的 API,具有更少的规范,提供了 Composition-API 风格的 API,最重要的是,在与 TypeScript 一起使用时具有可靠的类型推断支持。


相关推荐
2021-04-15
js日期、经纬度格式化
如果你不出去走走,你就会以为这就是全世界。——《天堂电影院》 如果你不出去走走,你就会以为这就是全世界。——《天堂电影院》 之前写过一篇js时间戳格式化以及一篇js中Date函数的api 今天写篇“人性化”的格式化的 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889// 格式化 传入毫秒值,计时秒表用function formatTime(time) { if (typeof time !== 'number' || time < 0) { return time } var hour = parseInt(time / 3600) time = time % 3600 var minute = parseInt(time / 6...
2023-07-14
gulpjs
瞒人之事弗为,害人之心弗存。——王豫 分享一个自动化和增强工作流程的工具包 GitHub - gulpjs/gulp: A toolkit to automate & enhance your workflow https://gulpjs.com/ 可以可帮助您在开发工作流程中自动执行痛苦或耗时的任务
2024-10-28
typescript-exercises(二)
亲善产生幸福,文明带来和谐。——雨果 题目: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566/*Intro: All 2 users liked the idea of the community. We should go forward and introduce some order. We are in Germany after all. Let's add a couple of admins. Initially, we only had users in the in-memory database. After introducing Admins, we need to fix the types so that everything works well together.Exercise: Type &q...
2023-08-16
vue-demi
事物都是互相妥协的。就是冰山也会时而消融,时而重新凝聚。——爱默生 分享一个vue库 https://github.com/vueuse/vue-demi 用来解决编写的代码在vue2和vue3之间的兼容问题 安装: 1npm i vue-demi 然后修改package.json,将vue 和@vue/composition-api添加到peerDependencies中 1234567891011121314151617{ "dependencies": { "vue-demi": "latest" }, "peerDependencies": { "@vue/composition-api": "^1.0.0-rc.1", "vue": "^2.0.0 || >=3.0.0" }, "peerDependenciesM...
2022-10-24
瀑布流组件vue-waterfall
坦白直率的言语,最容易打动悲哀的耳朵——莎士比亚 分享一个vue瀑布流组件 vue-waterfall git地址:https://github.com/MopTym/vue-waterfall.git 竖向排列demo:http://app.moptym.com/vue-waterfall/demo/vertical-line.html 横向排列:http://app.moptym.com/vue-waterfall/demo/horizontal-line.html 竖向+变大:http://app.moptym.com/vue-waterfall/demo/vertical-line-with-grow.html
2023-07-12
movyjs
早知如此绊人心,何如当初莫相识。 ——李白 分享一个开源项目 https://github.com/rossning92/movy 这是一个生成动画/视频的js库 它可以方便地创建动画,也可以直接转换为视频 例子:movy.js Editor
