Skip to content

Commit 0d8236b

Browse files
committed
docs: update code blocks syntax
1 parent b5dd9e9 commit 0d8236b

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

docs/content/en/accessor-introduction.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Make sure you define types correctly following [these instructions](/setup.html#
4747

4848
### Components, `fetch` and `asyncData`
4949

50-
```ts[~/components/sampleComponent.vue]
50+
```ts{}[components/sampleComponent.vue]
5151
import Vue from 'vue'
5252
5353
export default Vue.extend({
@@ -76,7 +76,7 @@ export default Vue.extend({
7676

7777
### Middleware
7878

79-
```ts[~/middleware/test.ts]
79+
```ts{}[middleware/test.ts]
8080
import { Context } from '@nuxt/types'
8181
8282
export default ({ redirect, app: { $accessor } }: Context) => {

docs/content/en/customisation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You might choose to customise the accessor function using the helper function `u
99

1010
## Injecting a custom accessor
1111

12-
```ts[~/plugins/custom-store-accessor.ts]
12+
```ts{}[plugins/custom-store-accessor.ts]
1313
import { useAccessor } from 'typed-vuex'
1414
import { InjectKey } from 'vue/types/options'
1515
import { Context } from '@nuxt/types'

docs/content/en/dynamic-modules.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can also use `typed-vuex` with dynamic modules.
99

1010
## Sample module
1111

12-
```ts[~/modules/dynamic-module.ts]
12+
```ts{}[modules/dynamic-module.ts]
1313
export const namespaced = true
1414
1515
export const state = () => ({
@@ -27,7 +27,7 @@ export const mutations = mutationTree(state, {
2727

2828
You might want to use the store
2929

30-
```ts[~/components/my-component.vue]
30+
```ts{}[components/my-component.vue]
3131
import Vue from 'vue
3232
3333
import { useAccessor, getAccessorType } from 'typed-vuex'
@@ -61,4 +61,5 @@ export default Vue.extend({
6161
}
6262
}
6363
})
64+
6465
```

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ position: 2
4141

4242
`buildModules` require Nuxt 2.10+. If you are using an older version, add `nuxt-typed-vuex` to `modules` instead.
4343

44-
</alert>
44+
</alert>
4545

4646
3. You will need to transpile this module, by adding the following to your `nuxt.config`:
4747

48-
```ts[nuxt.config.js]
48+
```ts{}[nuxt.config.js]
4949
build: {
5050
transpile: [
5151
/typed-vuex/,
@@ -61,7 +61,7 @@ The module will inject a store accessor throughout your project (`$accessor`). I
6161

6262
In your root store module, add the following code:
6363

64-
```ts[~store/index.ts]
64+
```ts{}[store/index.ts]
6565
import { getAccessorType } from 'typed-vuex'
6666
6767
// Import all your submodules
@@ -89,7 +89,7 @@ export const accessorType = getAccessorType({
8989

9090
Add the following type definitions to your project:
9191

92-
```ts[index.d.ts]
92+
```ts{}[index.d.ts]
9393
import { accessorType } from '~/store'
9494
9595
declare module 'vue/types/vue' {

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ Many of this project's default settings are based on Nuxt, so please file an iss
3232
```
3333

3434
</code-block>
35+
3536
</code-group>
3637

3738
2. Instantiate your accessor
3839

39-
```ts[~/src/store/index.ts]
40+
```ts{}[src/store/index.ts]
4041
import Vue from 'vue'
4142
import Vuex from 'vuex'
4243
@@ -97,7 +98,7 @@ Many of this project's default settings are based on Nuxt, so please file an iss
9798

9899
If you've injected the accessor globally, you'll want to define its type:
99100

100-
```ts[~/index.d.ts]
101+
```ts{}[index.d.ts]
101102
import Vue from 'vue'
102103
import { accessor } from './src/store'
103104

0 commit comments

Comments
 (0)