Skip to content

Commit d03893c

Browse files
Merge pull request #389 from J3m5/patch-2
docs(composition-api.md): Add missing closing script tags
2 parents 04058c0 + 07cdae8 commit d03893c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/composition-api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ export default {
229229
}
230230
}
231231
}
232+
<script>
232233
```
233234
234235
See the [Routing with useGet](#routing-with-useget) portion of the patterns section, below, to see how to hook up the above component to vue-router.
@@ -333,6 +334,7 @@ export default {
333334
}
334335
}
335336
}
337+
</script>
336338
```
337339

338340
### Deferring Queries
@@ -398,6 +400,7 @@ export default {
398400
}
399401
}
400402
}
403+
</script>
401404
```
402405

403406
Reviewing the above snippet, while there is no `patient` record, the `appointmentsParams` computed property returns `null` at comment `(1)`. This will prevent any query from going out to the API server.
@@ -468,6 +471,7 @@ export default {
468471
}
469472
}
470473
}
474+
</script>
471475
```
472476

473477
### Using queryWhen
@@ -512,6 +516,7 @@ export default {
512516
}
513517
}
514518
}
519+
</script>
515520
```
516521

517522
In the above example, the `patientQueryWhen` computed property will return `true` if we don't already have a `Patient` record in the store with the current `props.id`. While you could also achieve similar results by performing this logic inside of a `params` computed property, the `queryWhen` option works great as a "master override" to prevent unneeded queries.

0 commit comments

Comments
 (0)