Skip to content

Commit db380cf

Browse files
committed
docs: minor formatting
1 parent eb4c2d5 commit db380cf

File tree

7 files changed

+27
-14
lines changed

7 files changed

+27
-14
lines changed

packages/docs/.vitepress/components/VueSchoolLink.vue

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,11 @@
1010
</a>
1111
</div>
1212
</template>
13-
<script>
14-
export default {
15-
props: {
16-
href: { type: String, required: true },
17-
title: { type: String, required: true },
18-
},
19-
}
13+
14+
<script setup lang="ts">
15+
defineProps<{ href: string; title: string }>()
2016
</script>
17+
2118
<style scoped>
2219
.vueschool {
2320
margin-top: 20px;
@@ -55,4 +52,4 @@ export default {
5552
border-bottom: 5px solid transparent;
5653
border-left: 8px solid #fff;
5754
}
58-
</style>
55+
</style>

packages/docs/.vitepress/theme/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import VueSchoolLink from '../components/VueSchoolLink.vue'
33
import { Layout } from './Layout'
44
import './custom.css'
55
import './code-theme.css'
6-
// import { createPinia } from '../../../pinia'
6+
// import { createPinia } from 'pinia'
77

88
/** @type {import('vitepress').Theme} */
99
const config = {
@@ -12,6 +12,7 @@ const config = {
1212
Layout,
1313

1414
enhanceApp({ app }) {
15+
// app.use(createPinia())
1516
app.component('VueSchoolLink', VueSchoolLink)
1617
},
1718
}

packages/docs/core-concepts/actions.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Actions
22

3-
<VueSchoolLink href="https://vueschool.io/lessons/synchronous-and-asynchronous-actions-in-pinia"/>
3+
<VueSchoolLink
4+
href="https://vueschool.io/lessons/synchronous-and-asynchronous-actions-in-pinia"
5+
title="Learn all about actions in Pinia"
6+
/>
47

58
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**:
69

packages/docs/core-concepts/getters.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Getters
22

3-
<VueSchoolLink href="https://vueschool.io/lessons/getters-in-pinia"/>
3+
<VueSchoolLink
4+
href="https://vueschool.io/lessons/getters-in-pinia"
5+
title="Learn all about getters in Pinia"
6+
/>
47

58
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:
69

packages/docs/core-concepts/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Defining a Store
22

3-
<VueSchoolLink href="https://vueschool.io/lessons/define-your-first-pinia-store"/>
3+
<VueSchoolLink
4+
href="https://vueschool.io/lessons/define-your-first-pinia-store"
5+
title="Learn how to define and use stores in Pinia"
6+
/>
47

58
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:
69

packages/docs/core-concepts/state.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# State
22

3-
<VueSchoolLink href="https://vueschool.io/lessons/access-state-from-a-pinia-store"/>
3+
<VueSchoolLink
4+
href="https://vueschool.io/lessons/access-state-from-a-pinia-store"
5+
title="Learn all about state in Pinia"
6+
/>
47

58
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.
69

packages/docs/introduction.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Introduction
22

3-
<VueSchoolLink href="https://vueschool.io/lessons/introduction-to-pinia"/>
3+
<VueSchoolLink
4+
href="https://vueschool.io/lessons/introduction-to-pinia"
5+
title="Get started with Pinia"
6+
/>
47

58
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!
69

0 commit comments

Comments
 (0)