Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 89bb0e6

Browse files
committed
docs: docus updates
1 parent ddc9c0f commit 89bb0e6

File tree

12 files changed

+38
-38
lines changed

12 files changed

+38
-38
lines changed

docs/content/en/examples/useFetch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ fullscreen: True
66
position: 50
77
---
88

9-
<code-sandbox :src="link"></code-sandbox>
9+
<d-code-sandbox :src="link"></d-code-sandbox>

docs/content/en/getting-started/setup.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ version: 0.225
1010

1111
1. First, install `@nuxtjs/composition-api`:
1212

13-
<code-group>
14-
<code-block label="Yarn" active>
13+
<d-code-group>
14+
<d-code-block label="Yarn" active>
1515

1616
```bash
1717
yarn add @nuxtjs/composition-api
1818
```
1919

20-
</code-block><code-block label="NPM">
20+
</d-code-block><d-code-block label="NPM">
2121

2222
```bash
2323
npm install @nuxtjs/composition-api --save
2424
```
2525

26-
</code-block>
27-
</code-group>
26+
</d-code-block>
27+
</d-code-group>
2828

2929
2. Enable the module.
3030

@@ -51,10 +51,10 @@ version: 0.225
5151

5252
4. You're good to go!
5353

54-
<alert type="info">
54+
<d-alert type="info">
5555

5656
- The module automatically installs [`@vue/composition-api`](https://github.com/vuejs/composition-api) as a plugin, so you do not need to enable it separately.
5757

5858
- For convenience, this package also exports the [`@vue/composition-api`](https://github.com/vuejs/composition-api) methods and hooks, so you can import directly from `@nuxtjs/composition-api`.
5959

60-
</alert>
60+
</d-alert>

docs/content/en/helpers/reqRef.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ position: 32
1010

1111
`reqRef` declares a normal `ref` with one key difference. It resets the value of this ref on each request. You can find out [more information here](/getting-started/gotchas#shared-server-state).
1212

13-
<alert>You do not need a `reqRef` if you are using an `ssrRef` within a component setup function as it will be automatically tied to the per-request state.</alert>
13+
<d-alert>You do not need a `reqRef` if you are using an `ssrRef` within a component setup function as it will be automatically tied to the per-request state.</d-alert>
1414

15-
<alert type="warning">You should take especial care because of the danger of shared state when using refs in this way.</alert>
15+
<d-alert type="warning">You should take especial care because of the danger of shared state when using refs in this way.</d-alert>
1616

1717
## Example
1818

docs/content/en/helpers/ssrPromise.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ export default defineComponent({
3434
})
3535
```
3636

37-
<alert type="info">
37+
<d-alert type="info">
3838

3939
Under the hood, `ssrPromise` requires a key to ensure that the ref values match between client and server. If you have added `@nuxtjs/composition-api/module` to your `buildModules`, this will be done automagically by an injected Babel plugin. If you need to do things differently, you can specify a key manually or add `@nuxtjs/composition-api/dist/babel-plugin` to your Babel plugins.
4040

41-
</alert>
41+
</d-alert>
4242

43-
<alert>
43+
<d-alert>
4444

4545
At the moment, an `ssrPromise` is only suitable for one-offs, unless you provide your own unique key. [More information](/getting-started/gotchas#keyed-functions).
4646

47-
</alert>
47+
</d-alert>

docs/content/en/helpers/ssrRef.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ position: 34
88

99
When creating composition utility functions, often there will be server-side state that needs to be conveyed to the client.
1010

11-
<alert>If initialised within `setup()` or via `onGlobalSetup`, `ssrRef` data will exist _only_ within the request state. If initialised _outside_ a component there is the possibility that an `ssrRef` may share state across requests.</alert>
11+
<d-alert>If initialised within `setup()` or via `onGlobalSetup`, `ssrRef` data will exist _only_ within the request state. If initialised _outside_ a component there is the possibility that an `ssrRef` may share state across requests.</d-alert>
1212

1313
## ssrRef
1414

@@ -28,17 +28,17 @@ if (process.server) val.value = 'server set'
2828
const val2 = ssrRef(myExpensiveSetterFunction)
2929
```
3030

31-
<alert type="info">
31+
<d-alert type="info">
3232

3333
Under the hood, `ssrRef` requires a key to ensure that the ref values match between client and server. If you have added `@nuxtjs/composition-api/module` to your `buildModules`, this will be done automagically by an injected Babel plugin. If you need to do things differently, you can specify a key manually or add `@nuxtjs/composition-api/dist/babel-plugin` to your Babel plugins.
3434

35-
</alert>
35+
</d-alert>
3636

37-
<alert>
37+
<d-alert>
3838

3939
At the moment, an `ssrRef` is only suitable for one-offs, unless you provide your own unique key. [More information](/getting-started/gotchas#keyed-functions).
4040

41-
</alert>
41+
</d-alert>
4242

4343
## shallowSsrRef
4444

@@ -57,8 +57,8 @@ onMounted(() => {
5757
})
5858
```
5959

60-
<alert>
60+
<d-alert>
6161

6262
At the moment, a `shallowSsrRef` is only suitable for one-offs, unless you provide your own unique key. [More information](/getting-started/gotchas#keyed-functions).
6363

64-
</alert>
64+
</d-alert>

docs/content/en/helpers/useAsync.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export default defineComponent({
2525
})
2626
```
2727

28-
<alert>
28+
<d-alert>
2929

3030
At the moment, `useAsync` is only suitable for one-offs, unless you provide your own unique key. [More information](/getting-started/gotchas#keyed-functions).
3131

32-
</alert>
32+
</d-alert>

docs/content/en/helpers/useContext.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ export default defineComponent({
1919
})
2020
```
2121

22-
<alert type="info">Note that `route`, `query`, `from` and `params` are reactive refs (accessed with `.value`), but the rest of the context is not.</alert>
22+
<d-alert type="info">Note that `route`, `query`, `from` and `params` are reactive refs (accessed with `.value`), but the rest of the context is not.</d-alert>
2323

24-
<alert type="warning">To smooth your upgrade to Nuxt 3, it is recommended not to access `route`, `query`, `from` and `params` from `useContext` but rather to use the `useRoute` helper function.</alert>
24+
<d-alert type="warning">To smooth your upgrade to Nuxt 3, it is recommended not to access `route`, `query`, `from` and `params` from `useContext` but rather to use the `useRoute` helper function.</d-alert>

docs/content/en/helpers/useFetch.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,26 @@ export default defineComponent({
3333
})
3434
```
3535

36-
<alert>
36+
<d-alert>
3737

3838
`useFetch` must be called synchronously within `setup()`. Any changes made to component data - that is, to properties _returned_ from `setup()` - will be sent to the client and directly loaded. Other side-effects of `useFetch` hook will not be persisted.
3939

40-
</alert>
40+
</d-alert>
4141

42-
<alert type="warning">
42+
<d-alert type="warning">
4343

4444
`useFetch` should be used with `ref`s and not `ssrRef`s because state serialization and hydration is already covered by `useFetch`. Else, the state would be sent from server to client "twice", via the `ssrRef` and via `useFetch`
4545

46-
</alert>
46+
</d-alert>
4747

48-
<alert type="info">
48+
<d-alert type="info">
4949

5050
`$fetch` and `$fetchState` will already be defined on the instance - so no need to return `fetch` or `fetchState` from setup.
5151

52-
</alert>
52+
</d-alert>
5353

54-
<alert type="info">
54+
<d-alert type="info">
5555

5656
Note that `useFetch` doesn't support use within `onGlobalSetup`.
5757

58-
</alert>
58+
</d-alert>

docs/content/en/helpers/useStatic.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ If you are generating the whole app (or just prerendering some routes with `nuxt
3939
- On hard-reload of a generated page, the JSON will be inlined into the page and cached.
4040
- On client navigation to a generated page, this JSON will be fetched - and once fetched it will be cached for subsequent navigations. If for whatever reason this JSON doesn't exist, such as if the page _wasn't_ pre-generated, the original factory function will be run on client-side.
4141

42-
<alert>
42+
<d-alert>
4343

4444
If you are pregenerating some pages in your app note that you may need to increase `generate.interval`. (See [setup instructions](/getting-started/setup).)
4545

46-
</alert>
46+
</d-alert>
4747

4848
## SSR
4949

docs/content/en/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ items:
1717

1818
## Key features
1919

20-
<list :items="items"></list>
20+
<d-list :items="items"></d-list>
2121

2222
## API reference
2323

0 commit comments

Comments
 (0)