From: Daniel Kelly Date: Fri, 11 Feb 2022 08:30:35 +0000 (-0600) Subject: docs: add vue school links (#1045) X-Git-Tag: @pinia/testing@0.0.10~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb4c2d58a3395c6df215cb693a3c5c756b28a023;p=thirdparty%2Fvuejs%2Fpinia.git docs: add vue school links (#1045) --- diff --git a/packages/docs/.vitepress/components/VueSchoolLink.vue b/packages/docs/.vitepress/components/VueSchoolLink.vue new file mode 100644 index 00000000..16a36332 --- /dev/null +++ b/packages/docs/.vitepress/components/VueSchoolLink.vue @@ -0,0 +1,58 @@ + + + \ No newline at end of file diff --git a/packages/docs/.vitepress/theme/index.js b/packages/docs/.vitepress/theme/index.js index 7de26389..9e45f8c1 100644 --- a/packages/docs/.vitepress/theme/index.js +++ b/packages/docs/.vitepress/theme/index.js @@ -1,4 +1,5 @@ import Theme from 'vitepress/theme' +import VueSchoolLink from '../components/VueSchoolLink.vue' import { Layout } from './Layout' import './custom.css' import './code-theme.css' @@ -10,9 +11,9 @@ const config = { Layout, - // enhanceApp({ app }) { - // app.use(createPinia()) - // }, + enhanceApp({ app }) { + app.component('VueSchoolLink', VueSchoolLink) + }, } export default config diff --git a/packages/docs/core-concepts/actions.md b/packages/docs/core-concepts/actions.md index d6330edf..7cad0ca8 100644 --- a/packages/docs/core-concepts/actions.md +++ b/packages/docs/core-concepts/actions.md @@ -1,5 +1,7 @@ # 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**: ```js diff --git a/packages/docs/core-concepts/getters.md b/packages/docs/core-concepts/getters.md index 292a3b56..1681186b 100644 --- a/packages/docs/core-concepts/getters.md +++ b/packages/docs/core-concepts/getters.md @@ -1,5 +1,7 @@ # 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: ```js diff --git a/packages/docs/core-concepts/index.md b/packages/docs/core-concepts/index.md index 47c8854f..7e1e2987 100644 --- a/packages/docs/core-concepts/index.md +++ b/packages/docs/core-concepts/index.md @@ -1,5 +1,7 @@ # 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: ```js diff --git a/packages/docs/core-concepts/state.md b/packages/docs/core-concepts/state.md index 93c0ce8f..7c78cac1 100644 --- a/packages/docs/core-concepts/state.md +++ b/packages/docs/core-concepts/state.md @@ -1,5 +1,7 @@ # 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. ```js diff --git a/packages/docs/introduction.md b/packages/docs/introduction.md index 5b38493b..2ea3d71a 100644 --- a/packages/docs/introduction.md +++ b/packages/docs/introduction.md @@ -1,5 +1,7 @@ # 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! ## Why should I use Pinia?