From: Eduardo San Martin Morote Date: Fri, 11 Feb 2022 08:37:09 +0000 (+0100) Subject: docs: minor formatting X-Git-Tag: @pinia/testing@0.0.10~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db380cf509d2a70a9d4c766f3064741300cb3e61;p=thirdparty%2Fvuejs%2Fpinia.git docs: minor formatting --- diff --git a/packages/docs/.vitepress/components/VueSchoolLink.vue b/packages/docs/.vitepress/components/VueSchoolLink.vue index 16a36332..874bf751 100644 --- a/packages/docs/.vitepress/components/VueSchoolLink.vue +++ b/packages/docs/.vitepress/components/VueSchoolLink.vue @@ -10,14 +10,11 @@ - + \ No newline at end of file + diff --git a/packages/docs/.vitepress/theme/index.js b/packages/docs/.vitepress/theme/index.js index 9e45f8c1..e8749981 100644 --- a/packages/docs/.vitepress/theme/index.js +++ b/packages/docs/.vitepress/theme/index.js @@ -3,7 +3,7 @@ import VueSchoolLink from '../components/VueSchoolLink.vue' import { Layout } from './Layout' import './custom.css' import './code-theme.css' -// import { createPinia } from '../../../pinia' +// import { createPinia } from 'pinia' /** @type {import('vitepress').Theme} */ const config = { @@ -12,6 +12,7 @@ const config = { Layout, enhanceApp({ app }) { + // app.use(createPinia()) app.component('VueSchoolLink', VueSchoolLink) }, } diff --git a/packages/docs/core-concepts/actions.md b/packages/docs/core-concepts/actions.md index 7cad0ca8..8db70d68 100644 --- a/packages/docs/core-concepts/actions.md +++ b/packages/docs/core-concepts/actions.md @@ -1,6 +1,9 @@ # Actions - + Actions are the equivalent of [methods](https://v3.vuejs.org/guide/data-methods.html#methods) in components. They can be defined with the `actions` property in `defineStore()` and **they are perfect to define business logic**: diff --git a/packages/docs/core-concepts/getters.md b/packages/docs/core-concepts/getters.md index 1681186b..dc4d0cb5 100644 --- a/packages/docs/core-concepts/getters.md +++ b/packages/docs/core-concepts/getters.md @@ -1,6 +1,9 @@ # Getters - + Getters are exactly the equivalent of [computed values](https://v3.vuejs.org/guide/reactivity-computed-watchers.html#computed-values) for the state of a Store. They can be defined with the `getters` property in `defineStore()`. They receive the `state` as the first parameter **to encourage** the usage of arrow function: diff --git a/packages/docs/core-concepts/index.md b/packages/docs/core-concepts/index.md index 7e1e2987..4eb3fcc0 100644 --- a/packages/docs/core-concepts/index.md +++ b/packages/docs/core-concepts/index.md @@ -1,6 +1,9 @@ # Defining a Store - + Before diving into core concepts, we need to know that a store is defined using `defineStore()` and that it requires a **unique** name, passed as the first argument: diff --git a/packages/docs/core-concepts/state.md b/packages/docs/core-concepts/state.md index 7c78cac1..19e8b83e 100644 --- a/packages/docs/core-concepts/state.md +++ b/packages/docs/core-concepts/state.md @@ -1,6 +1,9 @@ # State - + The state is, most of the time, the central part of your store. People often start by defining the state that represents their app. In Pinia the state is defined as a function that returns the initial state. This allows Pinia to work in both Server and Client Side. diff --git a/packages/docs/introduction.md b/packages/docs/introduction.md index 2ea3d71a..d478bd1f 100644 --- a/packages/docs/introduction.md +++ b/packages/docs/introduction.md @@ -1,6 +1,9 @@ # Introduction - + Pinia [started](https://github.com/vuejs/pinia/commit/06aeef54e2cad66696063c62829dac74e15fd19e) as an experiment to redesign what a Store for Vue could look like with the [Composition API](https://github.com/vuejs/composition-api) around November 2019. Since then, the initial principles are still the same, but Pinia works for both Vue 2 and Vue 3 **and doesn't require you to use the composition API**. The API is the same for both except for _installation_ and _SSR_, and these docs are targeted to Vue 3 **with notes about Vue 2** whenever necessary so it can be read by Vue 2 and Vue 3 users!