摘要: 定义Store Store 是用defineStore()定义的,它的第一个参数要求是一个独一无二的名字: import { defineStore } from 'pinia' // 你可以对 `defineStore()` 的返回值进行任意命名,但最好使用 store 的名字,同时以 `use` 阅读全文
posted @ 2023-11-14 14:56 左扬 阅读(1384) 评论(0) 推荐(0) 编辑
摘要: Pinia —— Store 是什么? https://pinia.vuejs.org/zh/getting-started.html#what-is-a-store 一、Store 是什么? Store (如 Pinia) 是一个保存状态和业务逻辑的实体,它并不与你的组件树绑定。换句话说,它承载着 阅读全文
posted @ 2023-11-14 10:20 左扬 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 安装 Pinia 用你喜欢的包管理器安装 pinia: yarn add pinia # 或者使用 npm npm install pinia 安装结束。 阅读全文
posted @ 2023-11-14 10:13 左扬 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 介绍 Pinia https://pinia.vuejs.org/zh/introduction.html 一、简介 https://pinia.vuejs.org/zh/introduction.html#introduction Pinia 起始于 2019 年 11 月左右的一次实验,其目的是 阅读全文
posted @ 2023-11-14 09:52 左扬 阅读(115) 评论(0) 推荐(0) 编辑
levels of contents