Request usage example for preFetch in the <script setup lang=ts> block of a component
See original GitHub issueDescription
When using the composition api with the setup
attribute in the <script>
tag of a single file component, it isn’t clear from the documents how to declare the preFetch
method.
All the examples seem to be for the options api.
#...
<script setup lang=ts>
import {preFetch} from 'quasar/wrappers';
# then what?
#...
</script>
Documentation Section URL
Flavour
Quasar CLI with Webpack (@quasar/cli | @quasar/app-webpack)
Areas
TypeScript Support, SPA Mode
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
The 101 guide to Script Setup in Vue 3 - VueDose
Don't you know about Script Setup yet? Check out this short article now and learn the nicest way to define a Vue component...
Read more >Vue js Prefetch components - Stack Overflow
I solved this by creating a simple prefetch component that loads after a custom amount of time. Prefetch.vue <script> import LazyComp1 from ...
Read more ><script setup> | Vue.js
<script setup> is a compile-time syntactic sugar for using Composition API inside Single-File Components (SFCs). It is the recommended syntax if you are ......
Read more >Data Fetching · Get Started with Nuxt
Within your pages, components and plugins you can use useFetch to universally fetch from ... Example. app.vue <script setup>const { data: count }...
Read more >Full Stack SvelteKit For Beginners - Joy of Code
Because we're using a full stack framework we can create endpoints that correspond ... For example .svelte-kit/runtime/components holds the template for the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It was there all along.
I don’t know if this was added in the docs prior or later after this thread, but you can find an example of it here https://quasar.dev/quasar-cli-vite/prefetch-feature#usage