[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$KiqIp5Qu8t":3,"blog-\u002Fblog\u002Fa-comprehensive-guide-to-data-fetching-in-nuxt-3":52,"blogToc-\u002Fblog\u002Fa-comprehensive-guide-to-data-fetching-in-nuxt-3":2088,"blog-surrounding-\u002Fblog\u002Fa-comprehensive-guide-to-data-fetching-in-nuxt-3":3737,"blog-similar-posts-\u002Fblog\u002Fa-comprehensive-guide-to-data-fetching-in-nuxt-3":3746},{"id":4,"extension":5,"items":6,"meta":49,"stem":50,"__hash__":51},"menu\u002Fmenu.json","json",[7,12,16,20,24,28,32,36,41,45],{"i18nId":8,"to":9,"ariaLabel":10,"mainNavigation":11},"components.menu.home","\u002F","Home",true,{"i18nId":13,"to":14,"ariaLabel":15,"mainNavigation":11},"components.menu.about","\u002Fhire-me","About",{"i18nId":17,"to":18,"ariaLabel":19,"mainNavigation":11},"components.menu.testimonials","\u002Ftestimonials","Testimonials",{"i18nId":21,"to":22,"ariaLabel":23},"components.menu.contact","\u002Fcontact","Contact",{"i18nId":25,"to":26,"ariaLabel":27,"mainNavigation":11},"components.menu.blog","\u002Fblog","Blog",{"i18nId":29,"to":30,"ariaLabel":31,"mainNavigation":11},"components.menu.tips","\u002Fvue-tips","Vue Tips",{"i18nId":33,"to":34,"ariaLabel":35,"mainNavigation":11},"components.menu.projects","\u002Fprojects","Projects",{"i18nId":37,"to":38,"ariaLabel":39,"mainNavigation":40},"components.menu.stats","\u002Fstats","stats",false,{"i18nId":42,"to":43,"ariaLabel":44,"mainNavigation":40},"components.menu.businessCard","\u002Fbusiness-card","Business Card",{"i18nId":46,"to":47,"ariaLabel":48,"mainNavigation":40},"components.menu.publications","\u002Fpublications","Publications",{},"menu","njLT1QoRt2Dv8QWoVmH8xdTAiDywSj0bxBQdmoyWUE0",{"id":53,"title":54,"body":55,"categories":2067,"cover":2072,"date":2073,"description":2074,"extension":2075,"lastUpdated":2076,"meta":2077,"navigation":11,"ogImage":2076,"path":2078,"readingTime":2079,"robots":2076,"schemaOrg":2076,"seo":2084,"sitemap":2085,"stem":2086,"tags":2076,"__hash__":2087},"blog\u002Fblog\u002Fa-comprehensive-guide-to-data-fetching-in-nuxt-3\u002Findex.md","A Comprehensive Guide to Data Fetching in Nuxt 3",{"type":56,"value":57,"toc":2053},"minimark",[58,83,86,91,99,110,140,149,227,230,235,467,472,502,518,530,537,625,631,640,645,650,654,661,667,854,860,867,905,909,918,986,992,1014,1018,1025,1197,1204,1328,1332,1342,1486,1510,1517,1599,1604,1611,1614,1618,1625,1735,1748,1752,1755,1894,1901,1904,1920,1929,1975,1981,1992,1999,2003,2006,2032,2041,2049],[59,60,61,62,69,70,74,75,78,79,82],"p",{},"With Nuxt 3's ",[63,64,68],"a",{"href":65,"rel":66},"https:\u002F\u002Fnuxt.com\u002Fdocs\u002Fguide\u002Fconcepts\u002Frendering#rendering-modes",[67],"nofollow","rendering modes",", you can execute API calls and render pages both on the client and server, which has some challenges. For example, we want to avoid duplicate network calls, efficient caching, and ensure that the calls work across environments. To address these challenges, Nuxt provides a built-in data fetching library (",[71,72,73],"code",{},"$fetch",") and two composable (",[71,76,77],{},"useFetch"," and ",[71,80,81],{},"useAsyncData",").",[59,84,85],{},"In this article, I'll explain everything you need to know about the different data fetching methods available in Nuxt 3 and when to use them.",[87,88,90],"h2",{"id":89},"data-fetching-library","Data Fetching Library",[59,92,93,94],{},"Nuxt has a built-in library for data fetching: ",[63,95,98],{"href":96,"rel":97},"https:\u002F\u002Fgithub.com\u002Funjs\u002Fofetch",[67],"ofetch",[59,100,101,103,104,109],{},[71,102,98],{}," is built on top of the ",[63,105,108],{"href":106,"rel":107},"https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FFetch_API",[67],"fetch API"," and provides some handy features like:",[111,112,113,117,120,131,134],"ul",{},[114,115,116],"li",{},"Works on node, browser, and workers.",[114,118,119],{},"Smartly parses JSON and native values in the response.",[114,121,122,123,126,127,130],{},"Automatically throw errors when ",[71,124,125],{},"response.ok"," is ",[71,128,129],{},"false"," with a friendly error message and compact stack (hiding internals).",[114,132,133],{},"Automatically retries the request if an error happens.",[114,135,136,137,139],{},"You can provide async interceptors to hook into lifecycle events of ",[71,138,98],{}," calls.",[59,141,142,143,145,146,148],{},"You can use ",[71,144,98],{}," in your whole application with the ",[71,147,73],{}," alias:",[150,151,156],"pre",{"className":152,"code":153,"language":154,"meta":155,"style":155},"language-ts shiki shiki-themes github-light poimandres poimandres","const todos = await $fetch('\u002Fapi\u002Ftodos').catch((error) => error.data)\n","ts","",[71,157,158],{"__ignoreMap":155},[159,160,163,167,171,174,178,182,186,190,194,196,198,201,204,208,211,214,218,221,224],"span",{"class":161,"line":162},"line",1,[159,164,166],{"class":165},"slWGy","const",[159,168,170],{"class":169},"sGRIV"," todos",[159,172,173],{"class":165}," =",[159,175,177],{"class":176},"sdZ-l"," await",[159,179,181],{"class":180},"sHQ3f"," $fetch",[159,183,185],{"class":184},"sygvE","(",[159,187,189],{"class":188},"srEIG","'",[159,191,193],{"class":192},"skTdI","\u002Fapi\u002Ftodos",[159,195,189],{"class":188},[159,197,82],{"class":184},[159,199,200],{"class":180},"catch",[159,202,203],{"class":184},"((",[159,205,207],{"class":206},"sadQ_","error",[159,209,210],{"class":184},") ",[159,212,213],{"class":165},"=>",[159,215,217],{"class":216},"sMzB8"," error",[159,219,220],{"class":184},".",[159,222,223],{"class":216},"data",[159,225,226],{"class":184},")\n",[87,228,77],{"id":229},"usefetch",[59,231,232,234],{},[71,233,77],{}," is the most straightforward way to handle data fetching in a component setup function.",[150,236,247],{"className":237,"code":238,"filename":239,"highlights":240,"language":246,"meta":155,"style":155},"language-vue shiki shiki-themes github-light poimandres poimandres","\u003Cscript setup>\nconst { data, error, pending, refresh } = await useFetch('\u002Fapi\u002Ftodos')\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003Cspan v-if=\"pending\">Loading...\u003C\u002Fspan>\n  \u003Cspan v-else-if=\"data\">Todos: {{ data }}\u003C\u002Fspan>\n  \u003Cspan v-else-if=\"error\">Error: {{ error }}\u003C\u002Fspan>\n  \u003Cbutton @click=\"refresh\">Refresh\u003C\u002Fbutton>\n\u003C\u002Ftemplate>\n","Component.vue",[241,242,243,244,245],2,6,7,8,9,"vue",[71,248,249,265,312,322,328,338,371,400,428,458],{"__ignoreMap":155},[159,250,251,254,258,262],{"class":161,"line":162},[159,252,253],{"class":216},"\u003C",[159,255,257],{"class":256},"s8PnL","script",[159,259,261],{"class":260},"sppiw"," setup",[159,263,264],{"class":216},">\n",[159,266,269,271,274,276,279,281,283,286,288,291,294,297,299,302,304,306,308,310],{"class":267,"line":241},[161,268],"highlight",[159,270,166],{"class":165},[159,272,273],{"class":184}," { ",[159,275,223],{"class":169},[159,277,278],{"class":184},", ",[159,280,207],{"class":169},[159,282,278],{"class":184},[159,284,285],{"class":169},"pending",[159,287,278],{"class":184},[159,289,290],{"class":169},"refresh",[159,292,293],{"class":184}," } ",[159,295,296],{"class":165},"=",[159,298,177],{"class":176},[159,300,301],{"class":180}," useFetch",[159,303,185],{"class":184},[159,305,189],{"class":188},[159,307,193],{"class":192},[159,309,189],{"class":188},[159,311,226],{"class":184},[159,313,315,318,320],{"class":161,"line":314},3,[159,316,317],{"class":216},"\u003C\u002F",[159,319,257],{"class":256},[159,321,264],{"class":216},[159,323,325],{"class":161,"line":324},4,[159,326,327],{"emptyLinePlaceholder":11},"\n",[159,329,331,333,336],{"class":161,"line":330},5,[159,332,253],{"class":216},[159,334,335],{"class":256},"template",[159,337,264],{"class":216},[159,339,341,344,346,349,351,354,356,358,361,365,367,369],{"class":340,"line":242},[161,268],[159,342,343],{"class":216},"  \u003C",[159,345,159],{"class":256},[159,347,348],{"class":260}," v-if",[159,350,296],{"class":184},[159,352,353],{"class":188},"\"",[159,355,285],{"class":192},[159,357,353],{"class":188},[159,359,360],{"class":216},">",[159,362,364],{"class":363},"syBNg","Loading...",[159,366,317],{"class":216},[159,368,159],{"class":256},[159,370,264],{"class":216},[159,372,374,376,378,381,383,385,387,389,391,394,396,398],{"class":373,"line":243},[161,268],[159,375,343],{"class":216},[159,377,159],{"class":256},[159,379,380],{"class":260}," v-else-if",[159,382,296],{"class":184},[159,384,353],{"class":188},[159,386,223],{"class":192},[159,388,353],{"class":188},[159,390,360],{"class":216},[159,392,393],{"class":363},"Todos: {{ data }}",[159,395,317],{"class":216},[159,397,159],{"class":256},[159,399,264],{"class":216},[159,401,403,405,407,409,411,413,415,417,419,422,424,426],{"class":402,"line":244},[161,268],[159,404,343],{"class":216},[159,406,159],{"class":256},[159,408,380],{"class":260},[159,410,296],{"class":184},[159,412,353],{"class":188},[159,414,207],{"class":192},[159,416,353],{"class":188},[159,418,360],{"class":216},[159,420,421],{"class":363},"Error: {{ error }}",[159,423,317],{"class":216},[159,425,159],{"class":256},[159,427,264],{"class":216},[159,429,431,433,436,439,441,443,445,447,449,452,454,456],{"class":430,"line":245},[161,268],[159,432,343],{"class":216},[159,434,435],{"class":256},"button",[159,437,438],{"class":260}," @click",[159,440,296],{"class":184},[159,442,353],{"class":188},[159,444,290],{"class":192},[159,446,353],{"class":188},[159,448,360],{"class":216},[159,450,451],{"class":363},"Refresh",[159,453,317],{"class":216},[159,455,435],{"class":256},[159,457,264],{"class":216},[159,459,461,463,465],{"class":161,"line":460},10,[159,462,317],{"class":216},[159,464,335],{"class":256},[159,466,264],{"class":216},[59,468,469,471],{},[71,470,77],{}," returns three reactive variables and a function:",[111,473,474,479,484,489],{},[114,475,476,478],{},[71,477,223],{},": a reactive variable that contains the result of the asynchronous function that is passed in.",[114,480,481,483],{},[71,482,207],{},": a reactive error object containing information about the request error.",[114,485,486,488],{},[71,487,285],{},": a reactive boolean indicating whether the request is in progress.",[114,490,491,494,495,498,499,501],{},[71,492,493],{},"refresh\u002Fexecute",": a function to refresh the data returned by the ",[71,496,497],{},"handler"," function. By default, Nuxt waits until a ",[71,500,290],{}," is finished before it can be executed again.",[59,503,504,505,507,508,511,512,517],{},"The ",[71,506,77],{}," composable is responsible for forwarding the data to the client if the API call was executed on the server. This way, the client doesn't need to refetch the same data on the client side when the page hydrates. You can inspect this payload via ",[71,509,510],{},"useNuxtApp.payload()","; the ",[63,513,516],{"href":514,"rel":515},"https:\u002F\u002Fdevtools.nuxtjs.org\u002F",[67],"Nuxt DevTools"," visualize this data in the payload tab.",[59,519,520,522,523,525,526,529],{},[71,521,77],{}," additionally reduces API calls by using a key to cache API responses. The key is automatically generated based on the URL and the fetch options. The ",[71,524,77],{}," composable is auto-imported and can be used in ",[71,527,528],{},"setup"," functions, lifecycle hooks, and plugin or route middleware.",[59,531,532,533,536],{},"You can use the value of a ",[71,534,535],{},"ref"," in the URL string to ensure your component updates when the reactive variable changes:",[150,538,540],{"className":152,"code":539,"language":154,"meta":155,"style":155},"const todoId = ref('uuid')\n\nconst { data: tracks, pending, error } = useFetch(() => `\u002Fapi\u002Ftodos\u002F${todoId.value}`)\n",[71,541,542,565,569],{"__ignoreMap":155},[159,543,544,546,549,551,554,556,558,561,563],{"class":161,"line":162},[159,545,166],{"class":165},[159,547,548],{"class":169}," todoId",[159,550,173],{"class":165},[159,552,553],{"class":180}," ref",[159,555,185],{"class":184},[159,557,189],{"class":188},[159,559,560],{"class":192},"uuid",[159,562,189],{"class":188},[159,564,226],{"class":184},[159,566,567],{"class":161,"line":241},[159,568,327],{"emptyLinePlaceholder":11},[159,570,571,573,575,578,581,584,586,588,590,592,594,596,598,601,603,606,609,612,615,617,620,623],{"class":161,"line":314},[159,572,166],{"class":165},[159,574,273],{"class":184},[159,576,223],{"class":577},"sPC-1",[159,579,580],{"class":184},": ",[159,582,583],{"class":169},"tracks",[159,585,278],{"class":184},[159,587,285],{"class":169},[159,589,278],{"class":184},[159,591,207],{"class":169},[159,593,293],{"class":184},[159,595,296],{"class":165},[159,597,301],{"class":180},[159,599,600],{"class":184},"(() ",[159,602,213],{"class":165},[159,604,605],{"class":188}," `",[159,607,608],{"class":192},"\u002Fapi\u002Ftodos\u002F",[159,610,611],{"class":188},"${",[159,613,614],{"class":216},"todoId",[159,616,220],{"class":188},[159,618,619],{"class":216},"value",[159,621,622],{"class":188},"}`",[159,624,226],{"class":184},[59,626,627,628,630],{},"If the ",[71,629,614],{}," value changes, the URL will update accordingly and the data will be fetched again.",[59,632,633,634,639],{},"If you want, you can check out the ",[63,635,638],{"href":636,"rel":637},"https:\u002F\u002Fnuxt.com\u002Fdocs\u002Fapi\u002Fcomposables\u002Fuse-fetch",[67],"official documentation"," for more information.",[641,642,644],"h3",{"id":643},"options","Options",[59,646,647,649],{},[71,648,77],{}," accepts a set of options as the last argument, which can be used to control the behavior of the composable.",[641,651,653],{"id":652},"lazy","Lazy",[59,655,656,657,660],{},"Data-fetching composables will automatically wait for the asynchronous function to resolve before navigating to a new page when using Vue's Suspense. Nuxt uses Vue’s ",[71,658,659],{},"\u003CSuspense>"," component under the hood to prevent navigation before every async data is available to the view.",[59,662,663,664,666],{},"However, if you want to bypass this behavior during client-side navigation, you can use the ",[71,665,652],{}," option:",[150,668,671],{"className":237,"code":669,"filename":239,"highlights":670,"language":246,"meta":155,"style":155},"\u003Cscript setup>\nconst { pending, data: todos } = useFetch('\u002Fapi\u002Ftodos', {\n  lazy: true,\n})\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003Cdiv v-if=\"pending\">Loading ...\u003C\u002Fdiv>\n  \u003Cdiv v-else>\n    \u003Cdiv v-for=\"todo in todos\">\n      {{ todo.name }}\n    \u003C\u002Fdiv>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n",[314],[71,672,673,683,717,734,739,747,751,759,787,798,819,825,835,845],{"__ignoreMap":155},[159,674,675,677,679,681],{"class":161,"line":162},[159,676,253],{"class":216},[159,678,257],{"class":256},[159,680,261],{"class":260},[159,682,264],{"class":216},[159,684,685,687,689,691,693,695,697,700,702,704,706,708,710,712,714],{"class":161,"line":241},[159,686,166],{"class":165},[159,688,273],{"class":184},[159,690,285],{"class":169},[159,692,278],{"class":184},[159,694,223],{"class":577},[159,696,580],{"class":184},[159,698,699],{"class":169},"todos",[159,701,293],{"class":184},[159,703,296],{"class":165},[159,705,301],{"class":180},[159,707,185],{"class":184},[159,709,189],{"class":188},[159,711,193],{"class":192},[159,713,189],{"class":188},[159,715,716],{"class":184},", {\n",[159,718,720,724,727,731],{"class":719,"line":314},[161,268],[159,721,723],{"class":722},"srga6","  lazy",[159,725,726],{"class":184},":",[159,728,730],{"class":729},"s6g4C"," true",[159,732,733],{"class":184},",\n",[159,735,736],{"class":161,"line":324},[159,737,738],{"class":184},"})\n",[159,740,741,743,745],{"class":161,"line":330},[159,742,317],{"class":216},[159,744,257],{"class":256},[159,746,264],{"class":216},[159,748,749],{"class":161,"line":242},[159,750,327],{"emptyLinePlaceholder":11},[159,752,753,755,757],{"class":161,"line":243},[159,754,253],{"class":216},[159,756,335],{"class":256},[159,758,264],{"class":216},[159,760,761,763,766,768,770,772,774,776,778,781,783,785],{"class":161,"line":244},[159,762,343],{"class":216},[159,764,765],{"class":256},"div",[159,767,348],{"class":260},[159,769,296],{"class":184},[159,771,353],{"class":188},[159,773,285],{"class":192},[159,775,353],{"class":188},[159,777,360],{"class":216},[159,779,780],{"class":363},"Loading ...",[159,782,317],{"class":216},[159,784,765],{"class":256},[159,786,264],{"class":216},[159,788,789,791,793,796],{"class":161,"line":245},[159,790,343],{"class":216},[159,792,765],{"class":256},[159,794,795],{"class":260}," v-else",[159,797,264],{"class":216},[159,799,800,803,805,808,810,812,815,817],{"class":161,"line":460},[159,801,802],{"class":216},"    \u003C",[159,804,765],{"class":256},[159,806,807],{"class":260}," v-for",[159,809,296],{"class":184},[159,811,353],{"class":188},[159,813,814],{"class":192},"todo in todos",[159,816,353],{"class":188},[159,818,264],{"class":216},[159,820,822],{"class":161,"line":821},11,[159,823,824],{"class":363},"      {{ todo.name }}\n",[159,826,828,831,833],{"class":161,"line":827},12,[159,829,830],{"class":216},"    \u003C\u002F",[159,832,765],{"class":256},[159,834,264],{"class":216},[159,836,838,841,843],{"class":161,"line":837},13,[159,839,840],{"class":216},"  \u003C\u002F",[159,842,765],{"class":256},[159,844,264],{"class":216},[159,846,848,850,852],{"class":161,"line":847},14,[159,849,317],{"class":216},[159,851,335],{"class":256},[159,853,264],{"class":216},[59,855,856,857,859],{},"In such cases, you'll need to handle the loading state manually by using the ",[71,858,285],{}," value.",[59,861,862,863,866],{},"Alternatively, you have the option of using ",[71,864,865],{},"useLazyFetch"," which is a convenient method to achieve the same result:",[150,868,870],{"className":152,"code":869,"language":154,"meta":155,"style":155},"const { pending, data: todos } = useLazyFetch('\u002Fapi\u002Ftodos')\n",[71,871,872],{"__ignoreMap":155},[159,873,874,876,878,880,882,884,886,888,890,892,895,897,899,901,903],{"class":161,"line":162},[159,875,166],{"class":165},[159,877,273],{"class":184},[159,879,285],{"class":169},[159,881,278],{"class":184},[159,883,223],{"class":577},[159,885,580],{"class":184},[159,887,699],{"class":169},[159,889,293],{"class":184},[159,891,296],{"class":165},[159,893,894],{"class":180}," useLazyFetch",[159,896,185],{"class":184},[159,898,189],{"class":188},[159,900,193],{"class":192},[159,902,189],{"class":188},[159,904,226],{"class":184},[641,906,908],{"id":907},"client-only","Client-only",[59,910,911,912,915,916,726],{},"By default, data-fetching composables execute their asynchronous function in both client and server environments. To restrict the execution to the client side only, you can set the ",[71,913,914],{},"server"," option to ",[71,917,129],{},[150,919,922],{"className":152,"code":920,"highlights":921,"language":154,"meta":155,"style":155},"const { pending, data: posts } = useFetch('\u002Fapi\u002Fcomments', {\n  lazy: true,\n  server: false,\n})\n",[314],[71,923,924,958,968,982],{"__ignoreMap":155},[159,925,926,928,930,932,934,936,938,941,943,945,947,949,951,954,956],{"class":161,"line":162},[159,927,166],{"class":165},[159,929,273],{"class":184},[159,931,285],{"class":169},[159,933,278],{"class":184},[159,935,223],{"class":577},[159,937,580],{"class":184},[159,939,940],{"class":169},"posts",[159,942,293],{"class":184},[159,944,296],{"class":165},[159,946,301],{"class":180},[159,948,185],{"class":184},[159,950,189],{"class":188},[159,952,953],{"class":192},"\u002Fapi\u002Fcomments",[159,955,189],{"class":188},[159,957,716],{"class":184},[159,959,960,962,964,966],{"class":161,"line":241},[159,961,723],{"class":722},[159,963,726],{"class":184},[159,965,730],{"class":729},[159,967,733],{"class":184},[159,969,971,974,976,980],{"class":970,"line":314},[161,268],[159,972,973],{"class":722},"  server",[159,975,726],{"class":184},[159,977,979],{"class":978},"sQJmo"," false",[159,981,733],{"class":184},[159,983,984],{"class":161,"line":324},[159,985,738],{"class":184},[59,987,988,989,991],{},"This can be particularly useful when combined with the ",[71,990,652],{}," option for data that is not required during the initial rendering, such as non-SEO sensitive data.",[993,994,995,1002],"warning",{},[59,996,997,998,1001],{},"If you have not fetched data on the server, for instance using ",[71,999,1000],{},"server: false",", the data will not be fetched until the hydration process is complete.",[59,1003,1004,1005,1007,1008,1010,1011,220],{},"This implies that even if you await ",[71,1006,77],{}," on the client side, the ",[71,1009,223],{}," variable will continue to be null within ",[71,1012,1013],{},"\u003Cscript setup>",[641,1015,1017],{"id":1016},"minimize-payload-size","Minimize payload size",[59,1019,1020,1021,1024],{},"The ",[71,1022,1023],{},"pick"," option helps you minimize the payload size stored in your HTML document by selecting the fields you want to be returned from the composables:",[150,1026,1029],{"className":237,"code":1027,"filename":239,"highlights":1028,"language":246,"meta":155,"style":155},"\u003Cscript setup>\nconst { data: todos } = await useFetch('\u002Fapi\u002Ftodos', {\n  pick: ['id', 'name'],\n})\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003Cdiv v-for=\"todo in todos\">\n    \u003Cspan>{{ todo.name }}\u003C\u002Fspan>\n    \u003Cspan>{{ todo.id }}\u003C\u002Fspan>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n",[314,245,460],[71,1030,1031,1041,1071,1103,1107,1115,1119,1127,1145,1163,1181,1189],{"__ignoreMap":155},[159,1032,1033,1035,1037,1039],{"class":161,"line":162},[159,1034,253],{"class":216},[159,1036,257],{"class":256},[159,1038,261],{"class":260},[159,1040,264],{"class":216},[159,1042,1043,1045,1047,1049,1051,1053,1055,1057,1059,1061,1063,1065,1067,1069],{"class":161,"line":241},[159,1044,166],{"class":165},[159,1046,273],{"class":184},[159,1048,223],{"class":577},[159,1050,580],{"class":184},[159,1052,699],{"class":169},[159,1054,293],{"class":184},[159,1056,296],{"class":165},[159,1058,177],{"class":176},[159,1060,301],{"class":180},[159,1062,185],{"class":184},[159,1064,189],{"class":188},[159,1066,193],{"class":192},[159,1068,189],{"class":188},[159,1070,716],{"class":184},[159,1072,1074,1077,1079,1082,1084,1087,1089,1092,1095,1098,1100],{"class":1073,"line":314},[161,268],[159,1075,1076],{"class":722},"  pick",[159,1078,726],{"class":184},[159,1080,1081],{"class":184}," [",[159,1083,189],{"class":188},[159,1085,1086],{"class":192},"id",[159,1088,189],{"class":188},[159,1090,1091],{"class":184},",",[159,1093,1094],{"class":188}," '",[159,1096,1097],{"class":192},"name",[159,1099,189],{"class":188},[159,1101,1102],{"class":184},"],\n",[159,1104,1105],{"class":161,"line":324},[159,1106,738],{"class":184},[159,1108,1109,1111,1113],{"class":161,"line":330},[159,1110,317],{"class":216},[159,1112,257],{"class":256},[159,1114,264],{"class":216},[159,1116,1117],{"class":161,"line":242},[159,1118,327],{"emptyLinePlaceholder":11},[159,1120,1121,1123,1125],{"class":161,"line":243},[159,1122,253],{"class":216},[159,1124,335],{"class":256},[159,1126,264],{"class":216},[159,1128,1129,1131,1133,1135,1137,1139,1141,1143],{"class":161,"line":244},[159,1130,343],{"class":216},[159,1132,765],{"class":256},[159,1134,807],{"class":260},[159,1136,296],{"class":184},[159,1138,353],{"class":188},[159,1140,814],{"class":192},[159,1142,353],{"class":188},[159,1144,264],{"class":216},[159,1146,1148,1150,1152,1154,1157,1159,1161],{"class":1147,"line":245},[161,268],[159,1149,802],{"class":216},[159,1151,159],{"class":256},[159,1153,360],{"class":216},[159,1155,1156],{"class":363},"{{ todo.name }}",[159,1158,317],{"class":216},[159,1160,159],{"class":256},[159,1162,264],{"class":216},[159,1164,1166,1168,1170,1172,1175,1177,1179],{"class":1165,"line":460},[161,268],[159,1167,802],{"class":216},[159,1169,159],{"class":256},[159,1171,360],{"class":216},[159,1173,1174],{"class":363},"{{ todo.id }}",[159,1176,317],{"class":216},[159,1178,159],{"class":256},[159,1180,264],{"class":216},[159,1182,1183,1185,1187],{"class":161,"line":821},[159,1184,840],{"class":216},[159,1186,765],{"class":256},[159,1188,264],{"class":216},[159,1190,1191,1193,1195],{"class":161,"line":827},[159,1192,317],{"class":216},[159,1194,335],{"class":256},[159,1196,264],{"class":216},[59,1198,1199,1200,1203],{},"To gain more control or iterate over multiple objects, you can utilize the ",[71,1201,1202],{},"transform"," function to modify the query result:",[150,1205,1208],{"className":152,"code":1206,"highlights":1207,"language":154,"meta":155,"style":155},"const { data: todos } = await useFetch('\u002Fapi\u002Ftodos', {\n  transform: (todos) => {\n    return todos.map((todo) => ({ name: todo.title, id: todo.description }))\n  },\n})\n",[241,314,324],[71,1209,1210,1240,1263,1318,1324],{"__ignoreMap":155},[159,1211,1212,1214,1216,1218,1220,1222,1224,1226,1228,1230,1232,1234,1236,1238],{"class":161,"line":162},[159,1213,166],{"class":165},[159,1215,273],{"class":184},[159,1217,223],{"class":577},[159,1219,580],{"class":184},[159,1221,699],{"class":169},[159,1223,293],{"class":184},[159,1225,296],{"class":165},[159,1227,177],{"class":176},[159,1229,301],{"class":180},[159,1231,185],{"class":184},[159,1233,189],{"class":188},[159,1235,193],{"class":192},[159,1237,189],{"class":188},[159,1239,716],{"class":184},[159,1241,1243,1247,1249,1252,1254,1257,1260],{"class":1242,"line":241},[161,268],[159,1244,1246],{"class":1245},"sBmmg","  transform",[159,1248,726],{"class":184},[159,1250,1251],{"class":184}," (",[159,1253,699],{"class":206},[159,1255,1256],{"class":184},")",[159,1258,1259],{"class":165}," =>",[159,1261,1262],{"class":184}," {\n",[159,1264,1266,1269,1271,1273,1276,1278,1281,1283,1285,1288,1291,1293,1296,1298,1301,1303,1306,1308,1310,1312,1315],{"class":1265,"line":314},[161,268],[159,1267,1268],{"class":176},"    return",[159,1270,170],{"class":216},[159,1272,220],{"class":184},[159,1274,1275],{"class":180},"map",[159,1277,203],{"class":184},[159,1279,1280],{"class":206},"todo",[159,1282,1256],{"class":184},[159,1284,1259],{"class":165},[159,1286,1287],{"class":184}," ({",[159,1289,1290],{"class":722}," name",[159,1292,726],{"class":184},[159,1294,1295],{"class":216}," todo",[159,1297,220],{"class":184},[159,1299,1300],{"class":216},"title",[159,1302,1091],{"class":184},[159,1304,1305],{"class":722}," id",[159,1307,726],{"class":184},[159,1309,1295],{"class":216},[159,1311,220],{"class":184},[159,1313,1314],{"class":216},"description",[159,1316,1317],{"class":184}," }))\n",[159,1319,1321],{"class":1320,"line":324},[161,268],[159,1322,1323],{"class":184},"  },\n",[159,1325,1326],{"class":161,"line":330},[159,1327,738],{"class":184},[641,1329,1331],{"id":1330},"refetching","Refetching",[59,1333,1334,1335,1338,1339,1341],{},"To manually fetch or update data, you can employ the ",[71,1336,1337],{},"execute"," or ",[71,1340,290],{}," function offered by the composables:",[150,1343,1346],{"className":237,"code":1344,"filename":239,"highlights":1345,"language":246,"meta":155,"style":155},"\u003Cscript setup>\nconst { data, error, execute, refresh } = await useFetch('\u002Fapi\u002Ftodos')\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003Cdiv>\n    \u003Cp>{{ data }}\u003C\u002Fp>\n    \u003Cbutton @click=\"refresh\">Refresh data\u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n",[241,244],[71,1347,1348,1358,1397,1405,1409,1417,1425,1442,1470,1478],{"__ignoreMap":155},[159,1349,1350,1352,1354,1356],{"class":161,"line":162},[159,1351,253],{"class":216},[159,1353,257],{"class":256},[159,1355,261],{"class":260},[159,1357,264],{"class":216},[159,1359,1361,1363,1365,1367,1369,1371,1373,1375,1377,1379,1381,1383,1385,1387,1389,1391,1393,1395],{"class":1360,"line":241},[161,268],[159,1362,166],{"class":165},[159,1364,273],{"class":184},[159,1366,223],{"class":169},[159,1368,278],{"class":184},[159,1370,207],{"class":169},[159,1372,278],{"class":184},[159,1374,1337],{"class":169},[159,1376,278],{"class":184},[159,1378,290],{"class":169},[159,1380,293],{"class":184},[159,1382,296],{"class":165},[159,1384,177],{"class":176},[159,1386,301],{"class":180},[159,1388,185],{"class":184},[159,1390,189],{"class":188},[159,1392,193],{"class":192},[159,1394,189],{"class":188},[159,1396,226],{"class":184},[159,1398,1399,1401,1403],{"class":161,"line":314},[159,1400,317],{"class":216},[159,1402,257],{"class":256},[159,1404,264],{"class":216},[159,1406,1407],{"class":161,"line":324},[159,1408,327],{"emptyLinePlaceholder":11},[159,1410,1411,1413,1415],{"class":161,"line":330},[159,1412,253],{"class":216},[159,1414,335],{"class":256},[159,1416,264],{"class":216},[159,1418,1419,1421,1423],{"class":161,"line":242},[159,1420,343],{"class":216},[159,1422,765],{"class":256},[159,1424,264],{"class":216},[159,1426,1427,1429,1431,1433,1436,1438,1440],{"class":161,"line":243},[159,1428,802],{"class":216},[159,1430,59],{"class":256},[159,1432,360],{"class":216},[159,1434,1435],{"class":363},"{{ data }}",[159,1437,317],{"class":216},[159,1439,59],{"class":256},[159,1441,264],{"class":216},[159,1443,1445,1447,1449,1451,1453,1455,1457,1459,1461,1464,1466,1468],{"class":1444,"line":244},[161,268],[159,1446,802],{"class":216},[159,1448,435],{"class":256},[159,1450,438],{"class":260},[159,1452,296],{"class":184},[159,1454,353],{"class":188},[159,1456,290],{"class":192},[159,1458,353],{"class":188},[159,1460,360],{"class":216},[159,1462,1463],{"class":363},"Refresh data",[159,1465,317],{"class":216},[159,1467,435],{"class":256},[159,1469,264],{"class":216},[159,1471,1472,1474,1476],{"class":161,"line":245},[159,1473,840],{"class":216},[159,1475,765],{"class":256},[159,1477,264],{"class":216},[159,1479,1480,1482,1484],{"class":161,"line":460},[159,1481,317],{"class":216},[159,1483,335],{"class":256},[159,1485,264],{"class":216},[59,1487,1488,1489,1491,1492,1494,1495,1498,1499,1502,1503,1505,1506,1509],{},"Both functions serve the same purpose, but ",[71,1490,1337],{}," is an alias for ",[71,1493,290],{}," and is more semantically suitable when ",[71,1496,1497],{},"immediate: false"," is used. When the ",[71,1500,1501],{},"immediate"," option is set to ",[71,1504,129],{}," (defaults to ",[71,1507,1508],{},"true","), it will prevent the request from firing immediately.",[59,1511,1512,1513,1516],{},"Utilize the ",[71,1514,1515],{},"watch"," option to rerun your fetching function whenever other reactive values in your application undergo changes:",[150,1518,1521],{"className":152,"code":1519,"highlights":1520,"language":154,"meta":155,"style":155},"const count = ref(1)\n\nconst { data, error, refresh } = await useFetch('\u002Fapi\u002Ftodos', {\n  watch: [count],\n})\n",[162,324],[71,1522,1523,1542,1546,1580,1595],{"__ignoreMap":155},[159,1524,1526,1528,1531,1533,1535,1537,1540],{"class":1525,"line":162},[161,268],[159,1527,166],{"class":165},[159,1529,1530],{"class":169}," count",[159,1532,173],{"class":165},[159,1534,553],{"class":180},[159,1536,185],{"class":184},[159,1538,1539],{"class":729},"1",[159,1541,226],{"class":184},[159,1543,1544],{"class":161,"line":241},[159,1545,327],{"emptyLinePlaceholder":11},[159,1547,1548,1550,1552,1554,1556,1558,1560,1562,1564,1566,1568,1570,1572,1574,1576,1578],{"class":161,"line":314},[159,1549,166],{"class":165},[159,1551,273],{"class":184},[159,1553,223],{"class":169},[159,1555,278],{"class":184},[159,1557,207],{"class":169},[159,1559,278],{"class":184},[159,1561,290],{"class":169},[159,1563,293],{"class":184},[159,1565,296],{"class":165},[159,1567,177],{"class":176},[159,1569,301],{"class":180},[159,1571,185],{"class":184},[159,1573,189],{"class":188},[159,1575,193],{"class":192},[159,1577,189],{"class":188},[159,1579,716],{"class":184},[159,1581,1583,1586,1588,1590,1593],{"class":1582,"line":324},[161,268],[159,1584,1585],{"class":722},"  watch",[159,1587,726],{"class":184},[159,1589,1081],{"class":184},[159,1591,1592],{"class":216},"count",[159,1594,1102],{"class":184},[159,1596,1597],{"class":161,"line":330},[159,1598,738],{"class":184},[1600,1601,1603],"h4",{"id":1602},"when-to-userefreshvs-a-watch-option","When to use refresh vs. a watch option?",[59,1605,1606,1607,1610],{},"Use ",[71,1608,1609],{},"refresh()"," when you are aware that the data on the server side has been modified, and you need to update the data on the client side accordingly.",[59,1612,1613],{},"When the user modifies parameters that need to be sent to the server, set those parameters as a watch source. For instance, if you want to filter API results using a search parameter, watch that parameter. This ensures that whenever users change their query, fresh and accurate data will be reloaded from the API.",[641,1615,1617],{"id":1616},"query-search-params","Query Search Params",[59,1619,1620,1621,1624],{},"With the use of the ",[71,1622,1623],{},"query"," option, you can include search parameters in your query:",[150,1626,1629],{"className":152,"code":1627,"highlights":1628,"language":154,"meta":155,"style":155},"const queryValue = ref('anyValue')\n\nconst { data, pending, error, refresh } = await useFetch('\u002Fapi\u002Ftodos', {\n  query: { queryKey: queryValue, anotherQueryKey: 'anotherQueryValue' },\n})\n",[162,324],[71,1630,1631,1654,1658,1696,1731],{"__ignoreMap":155},[159,1632,1634,1636,1639,1641,1643,1645,1647,1650,1652],{"class":1633,"line":162},[161,268],[159,1635,166],{"class":165},[159,1637,1638],{"class":169}," queryValue",[159,1640,173],{"class":165},[159,1642,553],{"class":180},[159,1644,185],{"class":184},[159,1646,189],{"class":188},[159,1648,1649],{"class":192},"anyValue",[159,1651,189],{"class":188},[159,1653,226],{"class":184},[159,1655,1656],{"class":161,"line":241},[159,1657,327],{"emptyLinePlaceholder":11},[159,1659,1660,1662,1664,1666,1668,1670,1672,1674,1676,1678,1680,1682,1684,1686,1688,1690,1692,1694],{"class":161,"line":314},[159,1661,166],{"class":165},[159,1663,273],{"class":184},[159,1665,223],{"class":169},[159,1667,278],{"class":184},[159,1669,285],{"class":169},[159,1671,278],{"class":184},[159,1673,207],{"class":169},[159,1675,278],{"class":184},[159,1677,290],{"class":169},[159,1679,293],{"class":184},[159,1681,296],{"class":165},[159,1683,177],{"class":176},[159,1685,301],{"class":180},[159,1687,185],{"class":184},[159,1689,189],{"class":188},[159,1691,193],{"class":192},[159,1693,189],{"class":188},[159,1695,716],{"class":184},[159,1697,1699,1702,1704,1707,1710,1712,1714,1716,1719,1721,1723,1726,1728],{"class":1698,"line":324},[161,268],[159,1700,1701],{"class":722},"  query",[159,1703,726],{"class":184},[159,1705,1706],{"class":184}," {",[159,1708,1709],{"class":722}," queryKey",[159,1711,726],{"class":184},[159,1713,1638],{"class":216},[159,1715,1091],{"class":184},[159,1717,1718],{"class":722}," anotherQueryKey",[159,1720,726],{"class":184},[159,1722,1094],{"class":188},[159,1724,1725],{"class":192},"anotherQueryValue",[159,1727,189],{"class":188},[159,1729,1730],{"class":184}," },\n",[159,1732,1733],{"class":161,"line":330},[159,1734,738],{"class":184},[59,1736,1737,1738,1741,1742,1747],{},"This option is an extension of ",[63,1739,98],{"href":96,"rel":1740},[67]," and leverages ",[63,1743,1746],{"href":1744,"rel":1745},"https:\u002F\u002Fgithub.com\u002Funjs\u002Fufo",[67],"ufo"," to generate the URL. The objects provided are automatically converted to string format.",[641,1749,1751],{"id":1750},"interceptors","Interceptors",[59,1753,1754],{},"You can define async interceptors to hook into lifecycle events of the API call:",[150,1756,1759],{"className":152,"code":1757,"highlights":1758,"language":154,"meta":155,"style":155},"const { data, pending, error, refresh } = await useFetch('\u002Fapi\u002Ftodo', {\n  onRequest({ request, options }) {},\n  onRequestError({ request, options, error }) {},\n  onResponse({ request, response, options }) {},\n  onResponseError({ request, response, options }) {},\n})\n",[241,314,324,330],[71,1760,1761,1800,1823,1845,1868,1890],{"__ignoreMap":155},[159,1762,1763,1765,1767,1769,1771,1773,1775,1777,1779,1781,1783,1785,1787,1789,1791,1793,1796,1798],{"class":161,"line":162},[159,1764,166],{"class":165},[159,1766,273],{"class":184},[159,1768,223],{"class":169},[159,1770,278],{"class":184},[159,1772,285],{"class":169},[159,1774,278],{"class":184},[159,1776,207],{"class":169},[159,1778,278],{"class":184},[159,1780,290],{"class":169},[159,1782,293],{"class":184},[159,1784,296],{"class":165},[159,1786,177],{"class":176},[159,1788,301],{"class":180},[159,1790,185],{"class":184},[159,1792,189],{"class":188},[159,1794,1795],{"class":192},"\u002Fapi\u002Ftodo",[159,1797,189],{"class":188},[159,1799,716],{"class":184},[159,1801,1803,1806,1809,1812,1814,1817,1820],{"class":1802,"line":241},[161,268],[159,1804,1805],{"class":1245},"  onRequest",[159,1807,1808],{"class":184},"({",[159,1810,1811],{"class":206}," request",[159,1813,1091],{"class":184},[159,1815,1816],{"class":206}," options",[159,1818,1819],{"class":184}," })",[159,1821,1822],{"class":184}," {},\n",[159,1824,1826,1829,1831,1833,1835,1837,1839,1841,1843],{"class":1825,"line":314},[161,268],[159,1827,1828],{"class":1245},"  onRequestError",[159,1830,1808],{"class":184},[159,1832,1811],{"class":206},[159,1834,1091],{"class":184},[159,1836,1816],{"class":206},[159,1838,1091],{"class":184},[159,1840,217],{"class":206},[159,1842,1819],{"class":184},[159,1844,1822],{"class":184},[159,1846,1848,1851,1853,1855,1857,1860,1862,1864,1866],{"class":1847,"line":324},[161,268],[159,1849,1850],{"class":1245},"  onResponse",[159,1852,1808],{"class":184},[159,1854,1811],{"class":206},[159,1856,1091],{"class":184},[159,1858,1859],{"class":206}," response",[159,1861,1091],{"class":184},[159,1863,1816],{"class":206},[159,1865,1819],{"class":184},[159,1867,1822],{"class":184},[159,1869,1871,1874,1876,1878,1880,1882,1884,1886,1888],{"class":1870,"line":330},[161,268],[159,1872,1873],{"class":1245},"  onResponseError",[159,1875,1808],{"class":184},[159,1877,1811],{"class":206},[159,1879,1091],{"class":184},[159,1881,1859],{"class":206},[159,1883,1091],{"class":184},[159,1885,1816],{"class":206},[159,1887,1819],{"class":184},[159,1889,1822],{"class":184},[159,1891,1892],{"class":161,"line":242},[159,1893,738],{"class":184},[59,1895,1896,1897,1900],{},"These options are provided by the built-in ",[63,1898,98],{"href":96,"rel":1899},[67]," library.",[87,1902,81],{"id":1903},"useasyncdata",[59,1905,1906,1908,1909,1911,1912,1915,1916,1919],{},[71,1907,77],{}," is designed to fetch data from a given URL, while ",[71,1910,81],{}," allows for more intricate logic. Essentially, ",[71,1913,1914],{},"useFetch(url)"," is almost equivalent to ",[71,1917,1918],{},"useAsyncData(url, () => $fetch(url))",", providing a more streamlined developer experience for the most common use case.",[59,1921,1922,1923,1925,1926,1928],{},"However, there are situations where employing the ",[71,1924,77],{}," composable may not be suitable, such as when a CMS or a third-party service offers its own query layer. In such cases, you can utilize ",[71,1927,81],{}," to encapsulate your calls and still enjoy the benefits provided by the composable:",[150,1930,1932],{"className":152,"code":1931,"language":154,"meta":155,"style":155},"const { data, error } = await useAsyncData('getTodos', () => fetchTodos())\n",[71,1933,1934],{"__ignoreMap":155},[159,1935,1936,1938,1940,1942,1944,1946,1948,1950,1952,1955,1957,1959,1962,1964,1967,1969,1972],{"class":161,"line":162},[159,1937,166],{"class":165},[159,1939,273],{"class":184},[159,1941,223],{"class":169},[159,1943,278],{"class":184},[159,1945,207],{"class":169},[159,1947,293],{"class":184},[159,1949,296],{"class":165},[159,1951,177],{"class":176},[159,1953,1954],{"class":180}," useAsyncData",[159,1956,185],{"class":184},[159,1958,189],{"class":188},[159,1960,1961],{"class":192},"getTodos",[159,1963,189],{"class":188},[159,1965,1966],{"class":184},", () ",[159,1968,213],{"class":165},[159,1970,1971],{"class":180}," fetchTodos",[159,1973,1974],{"class":184},"())\n",[59,1976,1977,1978,1980],{},"In ",[71,1979,81],{},", the first argument serves as the unique key for caching the response obtained from the second argument, which is the querying function. However, if you prefer, you can omit this argument and directly pass the querying function itself. In such cases, the unique key will be automatically generated.",[1982,1983,1984],"note",{},[59,1985,1986,1987,78,1989,1991],{},"Both ",[71,1988,81],{},[71,1990,77],{}," provide the same object type as their return value and accept a shared set of options as their last argument. These options allow you to customize the behavior of the composables, including features such as navigation blocking, caching, and execution control.",[59,1993,1994,1995,639],{},"You can check out the ",[63,1996,638],{"href":1997,"rel":1998},"https:\u002F\u002Fnuxt.com\u002Fdocs\u002Fapi\u002Fcomposables\u002Fuse-async-data",[67],[87,2000,2002],{"id":2001},"conclusion","Conclusion",[59,2004,2005],{},"Let's summarize and explain when you should use which data fetching method:",[111,2007,2008,2019,2024],{},[114,2009,504,2010,2012,2013,2015,2016,2018],{},[71,2011,73],{}," function is a suitable choice if you intend to initiate a network request based on user interaction. It is recommended to utilize ",[71,2014,73],{}," when sending data to an event handler, performing client-side logic exclusively, or in conjunction with the ",[71,2017,81],{}," composable.",[114,2020,504,2021,2023],{},[71,2022,77],{}," composable is the simplest approach to handle data fetching within a component's setup function.",[114,2025,2026,2027,2029,2030,220],{},"If you require more precise control over the data fetching process, you can opt for ",[71,2028,81],{}," in combination with ",[71,2031,73],{},[59,2033,2034,2035,2040],{},"If you liked this article, follow me on ",[63,2036,2039],{"href":2037,"rel":2038},"https:\u002F\u002Ftwitter.com\u002Fmokkapps",[67],"Twitter"," to get notified about new blog posts and more content from me.",[59,2042,2043,2044,726],{},"Alternatively (or additionally), you can ",[63,2045,2048],{"href":2046,"rel":2047},"https:\u002F\u002Fweekly-vue.news",[67],"subscribe to my weekly Vue newsletter",[2050,2051,2052],"style",{},"html pre.shiki code .slWGy, html code.shiki .slWGy{--shiki-light:#D73A49;--shiki-default:#91B4D5;--shiki-dark:#91B4D5}html pre.shiki code .sGRIV, html code.shiki .sGRIV{--shiki-light:#005CC5;--shiki-default:#E4F0FB;--shiki-dark:#E4F0FB}html pre.shiki code .sdZ-l, html code.shiki .sdZ-l{--shiki-light:#D73A49;--shiki-default:#5DE4C7C0;--shiki-dark:#5DE4C7C0}html pre.shiki code .sHQ3f, html code.shiki .sHQ3f{--shiki-light:#6F42C1;--shiki-default:#E4F0FBD0;--shiki-dark:#E4F0FBD0}html pre.shiki code .sygvE, html code.shiki .sygvE{--shiki-light:#24292E;--shiki-default:#A6ACCD;--shiki-dark:#A6ACCD}html pre.shiki code .srEIG, html code.shiki .srEIG{--shiki-light:#032F62;--shiki-default:#A6ACCD;--shiki-dark:#A6ACCD}html pre.shiki code .skTdI, html code.shiki .skTdI{--shiki-light:#032F62;--shiki-default:#5DE4C7;--shiki-dark:#5DE4C7}html pre.shiki code .sadQ_, html code.shiki .sadQ_{--shiki-light:#E36209;--shiki-default:#E4F0FB;--shiki-dark:#E4F0FB}html pre.shiki code .sMzB8, html code.shiki .sMzB8{--shiki-light:#24292E;--shiki-default:#E4F0FB;--shiki-dark:#E4F0FB}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s8PnL, html code.shiki .s8PnL{--shiki-light:#22863A;--shiki-default:#5DE4C7;--shiki-dark:#5DE4C7}html pre.shiki code .sppiw, html code.shiki .sppiw{--shiki-light:#6F42C1;--shiki-light-font-style:inherit;--shiki-default:#91B4D5;--shiki-default-font-style:italic;--shiki-dark:#91B4D5;--shiki-dark-font-style:italic}html pre.shiki code .syBNg, html code.shiki .syBNg{--shiki-light:#24292E;--shiki-default:#5DE4C7;--shiki-dark:#5DE4C7}html pre.shiki code .sPC-1, html code.shiki .sPC-1{--shiki-light:#E36209;--shiki-default:#A6ACCD;--shiki-dark:#A6ACCD}html pre.shiki code .srga6, html code.shiki .srga6{--shiki-light:#24292E;--shiki-default:#ADD7FF;--shiki-dark:#ADD7FF}html pre.shiki code .s6g4C, html code.shiki .s6g4C{--shiki-light:#005CC5;--shiki-default:#5DE4C7;--shiki-dark:#5DE4C7}html pre.shiki code .sQJmo, html code.shiki .sQJmo{--shiki-light:#005CC5;--shiki-default:#D0679D;--shiki-dark:#D0679D}html pre.shiki code .sBmmg, html code.shiki .sBmmg{--shiki-light:#6F42C1;--shiki-default:#ADD7FF;--shiki-dark:#ADD7FF}",{"title":155,"searchDepth":241,"depth":241,"links":2054},[2055,2056,2065,2066],{"id":89,"depth":241,"text":90},{"id":229,"depth":241,"text":77,"children":2057},[2058,2059,2060,2061,2062,2063,2064],{"id":643,"depth":314,"text":644},{"id":652,"depth":314,"text":653},{"id":907,"depth":314,"text":908},{"id":1016,"depth":314,"text":1017},{"id":1330,"depth":314,"text":1331},{"id":1616,"depth":314,"text":1617},{"id":1750,"depth":314,"text":1751},{"id":1903,"depth":241,"text":81},{"id":2001,"depth":241,"text":2002},[2068,2069,2070,2071],"development","frontend","vue-js","nuxt-js","blog\u002Fa-comprehensive-guide-to-data-fetching-in-nuxt-3\u002Fog.png","2023-06-20","With Nuxt 3's rendering modes, you can execute API calls and render pages both on the client and server, which has some challenges. For example, we want to avoid duplicate network calls, efficient caching, and ensure that the calls work across environments. To address these challenges, Nuxt provides a built-in data fetching library ($fetch) and two composable (useFetch and useAsyncData).","md",null,{},"\u002Fblog\u002Fa-comprehensive-guide-to-data-fetching-in-nuxt-3",{"text":2080,"minutes":2081,"time":2082,"words":2083},"7 min read",6.855,411300,1371,{"title":54,"description":2074},{"loc":2078,"lastmod":2073},"blog\u002Fa-comprehensive-guide-to-data-fetching-in-nuxt-3\u002Findex","eNId2ITwKxhhCYjHeUCIVozHY6badmcW5rPvzb6Ks6w",{"id":2089,"title":54,"body":2090,"cover":2072,"description":2074,"extension":2075,"meta":3731,"navigation":11,"path":2078,"robots":2076,"seo":3734,"sitemap":3735,"stem":2086,"__hash__":3736},"content\u002Fblog\u002Fa-comprehensive-guide-to-data-fetching-in-nuxt-3\u002Findex.md",{"type":56,"value":2091,"toc":3717},[2092,2103,2105,2107,2112,2119,2137,2143,2187,2189,2193,2383,2387,2409,2418,2426,2430,2504,2508,2513,2515,2519,2521,2525,2529,2693,2697,2701,2737,2739,2745,2807,2811,2825,2827,2831,2993,2997,3103,3105,3111,3252,3266,3270,3347,3349,3353,3355,3357,3361,3462,3470,3472,3474,3601,3606,3608,3618,3624,3664,3668,3676,3681,3683,3685,3705,3710,3715],[59,2093,61,2094,69,2097,74,2099,78,2101,82],{},[63,2095,68],{"href":65,"rel":2096},[67],[71,2098,73],{},[71,2100,77],{},[71,2102,81],{},[59,2104,85],{},[87,2106,90],{"id":89},[59,2108,93,2109],{},[63,2110,98],{"href":96,"rel":2111},[67],[59,2113,2114,103,2116,109],{},[71,2115,98],{},[63,2117,108],{"href":106,"rel":2118},[67],[111,2120,2121,2123,2125,2131,2133],{},[114,2122,116],{},[114,2124,119],{},[114,2126,122,2127,126,2129,130],{},[71,2128,125],{},[71,2130,129],{},[114,2132,133],{},[114,2134,136,2135,139],{},[71,2136,98],{},[59,2138,142,2139,145,2141,148],{},[71,2140,98],{},[71,2142,73],{},[150,2144,2145],{"className":152,"code":153,"language":154,"meta":155,"style":155},[71,2146,2147],{"__ignoreMap":155},[159,2148,2149,2151,2153,2155,2157,2159,2161,2163,2165,2167,2169,2171,2173,2175,2177,2179,2181,2183,2185],{"class":161,"line":162},[159,2150,166],{"class":165},[159,2152,170],{"class":169},[159,2154,173],{"class":165},[159,2156,177],{"class":176},[159,2158,181],{"class":180},[159,2160,185],{"class":184},[159,2162,189],{"class":188},[159,2164,193],{"class":192},[159,2166,189],{"class":188},[159,2168,82],{"class":184},[159,2170,200],{"class":180},[159,2172,203],{"class":184},[159,2174,207],{"class":206},[159,2176,210],{"class":184},[159,2178,213],{"class":165},[159,2180,217],{"class":216},[159,2182,220],{"class":184},[159,2184,223],{"class":216},[159,2186,226],{"class":184},[87,2188,77],{"id":229},[59,2190,2191,234],{},[71,2192,77],{},[150,2194,2196],{"className":237,"code":238,"filename":239,"highlights":2195,"language":246,"meta":155,"style":155},[241,242,243,244,245],[71,2197,2198,2208,2247,2255,2259,2267,2294,2321,2348,2375],{"__ignoreMap":155},[159,2199,2200,2202,2204,2206],{"class":161,"line":162},[159,2201,253],{"class":216},[159,2203,257],{"class":256},[159,2205,261],{"class":260},[159,2207,264],{"class":216},[159,2209,2211,2213,2215,2217,2219,2221,2223,2225,2227,2229,2231,2233,2235,2237,2239,2241,2243,2245],{"class":2210,"line":241},[161,268],[159,2212,166],{"class":165},[159,2214,273],{"class":184},[159,2216,223],{"class":169},[159,2218,278],{"class":184},[159,2220,207],{"class":169},[159,2222,278],{"class":184},[159,2224,285],{"class":169},[159,2226,278],{"class":184},[159,2228,290],{"class":169},[159,2230,293],{"class":184},[159,2232,296],{"class":165},[159,2234,177],{"class":176},[159,2236,301],{"class":180},[159,2238,185],{"class":184},[159,2240,189],{"class":188},[159,2242,193],{"class":192},[159,2244,189],{"class":188},[159,2246,226],{"class":184},[159,2248,2249,2251,2253],{"class":161,"line":314},[159,2250,317],{"class":216},[159,2252,257],{"class":256},[159,2254,264],{"class":216},[159,2256,2257],{"class":161,"line":324},[159,2258,327],{"emptyLinePlaceholder":11},[159,2260,2261,2263,2265],{"class":161,"line":330},[159,2262,253],{"class":216},[159,2264,335],{"class":256},[159,2266,264],{"class":216},[159,2268,2270,2272,2274,2276,2278,2280,2282,2284,2286,2288,2290,2292],{"class":2269,"line":242},[161,268],[159,2271,343],{"class":216},[159,2273,159],{"class":256},[159,2275,348],{"class":260},[159,2277,296],{"class":184},[159,2279,353],{"class":188},[159,2281,285],{"class":192},[159,2283,353],{"class":188},[159,2285,360],{"class":216},[159,2287,364],{"class":363},[159,2289,317],{"class":216},[159,2291,159],{"class":256},[159,2293,264],{"class":216},[159,2295,2297,2299,2301,2303,2305,2307,2309,2311,2313,2315,2317,2319],{"class":2296,"line":243},[161,268],[159,2298,343],{"class":216},[159,2300,159],{"class":256},[159,2302,380],{"class":260},[159,2304,296],{"class":184},[159,2306,353],{"class":188},[159,2308,223],{"class":192},[159,2310,353],{"class":188},[159,2312,360],{"class":216},[159,2314,393],{"class":363},[159,2316,317],{"class":216},[159,2318,159],{"class":256},[159,2320,264],{"class":216},[159,2322,2324,2326,2328,2330,2332,2334,2336,2338,2340,2342,2344,2346],{"class":2323,"line":244},[161,268],[159,2325,343],{"class":216},[159,2327,159],{"class":256},[159,2329,380],{"class":260},[159,2331,296],{"class":184},[159,2333,353],{"class":188},[159,2335,207],{"class":192},[159,2337,353],{"class":188},[159,2339,360],{"class":216},[159,2341,421],{"class":363},[159,2343,317],{"class":216},[159,2345,159],{"class":256},[159,2347,264],{"class":216},[159,2349,2351,2353,2355,2357,2359,2361,2363,2365,2367,2369,2371,2373],{"class":2350,"line":245},[161,268],[159,2352,343],{"class":216},[159,2354,435],{"class":256},[159,2356,438],{"class":260},[159,2358,296],{"class":184},[159,2360,353],{"class":188},[159,2362,290],{"class":192},[159,2364,353],{"class":188},[159,2366,360],{"class":216},[159,2368,451],{"class":363},[159,2370,317],{"class":216},[159,2372,435],{"class":256},[159,2374,264],{"class":216},[159,2376,2377,2379,2381],{"class":161,"line":460},[159,2378,317],{"class":216},[159,2380,335],{"class":256},[159,2382,264],{"class":216},[59,2384,2385,471],{},[71,2386,77],{},[111,2388,2389,2393,2397,2401],{},[114,2390,2391,478],{},[71,2392,223],{},[114,2394,2395,483],{},[71,2396,207],{},[114,2398,2399,488],{},[71,2400,285],{},[114,2402,2403,494,2405,498,2407,501],{},[71,2404,493],{},[71,2406,497],{},[71,2408,290],{},[59,2410,504,2411,507,2413,511,2415,517],{},[71,2412,77],{},[71,2414,510],{},[63,2416,516],{"href":514,"rel":2417},[67],[59,2419,2420,522,2422,525,2424,529],{},[71,2421,77],{},[71,2423,77],{},[71,2425,528],{},[59,2427,532,2428,536],{},[71,2429,535],{},[150,2431,2432],{"className":152,"code":539,"language":154,"meta":155,"style":155},[71,2433,2434,2454,2458],{"__ignoreMap":155},[159,2435,2436,2438,2440,2442,2444,2446,2448,2450,2452],{"class":161,"line":162},[159,2437,166],{"class":165},[159,2439,548],{"class":169},[159,2441,173],{"class":165},[159,2443,553],{"class":180},[159,2445,185],{"class":184},[159,2447,189],{"class":188},[159,2449,560],{"class":192},[159,2451,189],{"class":188},[159,2453,226],{"class":184},[159,2455,2456],{"class":161,"line":241},[159,2457,327],{"emptyLinePlaceholder":11},[159,2459,2460,2462,2464,2466,2468,2470,2472,2474,2476,2478,2480,2482,2484,2486,2488,2490,2492,2494,2496,2498,2500,2502],{"class":161,"line":314},[159,2461,166],{"class":165},[159,2463,273],{"class":184},[159,2465,223],{"class":577},[159,2467,580],{"class":184},[159,2469,583],{"class":169},[159,2471,278],{"class":184},[159,2473,285],{"class":169},[159,2475,278],{"class":184},[159,2477,207],{"class":169},[159,2479,293],{"class":184},[159,2481,296],{"class":165},[159,2483,301],{"class":180},[159,2485,600],{"class":184},[159,2487,213],{"class":165},[159,2489,605],{"class":188},[159,2491,608],{"class":192},[159,2493,611],{"class":188},[159,2495,614],{"class":216},[159,2497,220],{"class":188},[159,2499,619],{"class":216},[159,2501,622],{"class":188},[159,2503,226],{"class":184},[59,2505,627,2506,630],{},[71,2507,614],{},[59,2509,633,2510,639],{},[63,2511,638],{"href":636,"rel":2512},[67],[641,2514,644],{"id":643},[59,2516,2517,649],{},[71,2518,77],{},[641,2520,653],{"id":652},[59,2522,656,2523,660],{},[71,2524,659],{},[59,2526,663,2527,666],{},[71,2528,652],{},[150,2530,2532],{"className":237,"code":669,"filename":239,"highlights":2531,"language":246,"meta":155,"style":155},[314],[71,2533,2534,2544,2576,2587,2591,2599,2603,2611,2637,2647,2665,2669,2677,2685],{"__ignoreMap":155},[159,2535,2536,2538,2540,2542],{"class":161,"line":162},[159,2537,253],{"class":216},[159,2539,257],{"class":256},[159,2541,261],{"class":260},[159,2543,264],{"class":216},[159,2545,2546,2548,2550,2552,2554,2556,2558,2560,2562,2564,2566,2568,2570,2572,2574],{"class":161,"line":241},[159,2547,166],{"class":165},[159,2549,273],{"class":184},[159,2551,285],{"class":169},[159,2553,278],{"class":184},[159,2555,223],{"class":577},[159,2557,580],{"class":184},[159,2559,699],{"class":169},[159,2561,293],{"class":184},[159,2563,296],{"class":165},[159,2565,301],{"class":180},[159,2567,185],{"class":184},[159,2569,189],{"class":188},[159,2571,193],{"class":192},[159,2573,189],{"class":188},[159,2575,716],{"class":184},[159,2577,2579,2581,2583,2585],{"class":2578,"line":314},[161,268],[159,2580,723],{"class":722},[159,2582,726],{"class":184},[159,2584,730],{"class":729},[159,2586,733],{"class":184},[159,2588,2589],{"class":161,"line":324},[159,2590,738],{"class":184},[159,2592,2593,2595,2597],{"class":161,"line":330},[159,2594,317],{"class":216},[159,2596,257],{"class":256},[159,2598,264],{"class":216},[159,2600,2601],{"class":161,"line":242},[159,2602,327],{"emptyLinePlaceholder":11},[159,2604,2605,2607,2609],{"class":161,"line":243},[159,2606,253],{"class":216},[159,2608,335],{"class":256},[159,2610,264],{"class":216},[159,2612,2613,2615,2617,2619,2621,2623,2625,2627,2629,2631,2633,2635],{"class":161,"line":244},[159,2614,343],{"class":216},[159,2616,765],{"class":256},[159,2618,348],{"class":260},[159,2620,296],{"class":184},[159,2622,353],{"class":188},[159,2624,285],{"class":192},[159,2626,353],{"class":188},[159,2628,360],{"class":216},[159,2630,780],{"class":363},[159,2632,317],{"class":216},[159,2634,765],{"class":256},[159,2636,264],{"class":216},[159,2638,2639,2641,2643,2645],{"class":161,"line":245},[159,2640,343],{"class":216},[159,2642,765],{"class":256},[159,2644,795],{"class":260},[159,2646,264],{"class":216},[159,2648,2649,2651,2653,2655,2657,2659,2661,2663],{"class":161,"line":460},[159,2650,802],{"class":216},[159,2652,765],{"class":256},[159,2654,807],{"class":260},[159,2656,296],{"class":184},[159,2658,353],{"class":188},[159,2660,814],{"class":192},[159,2662,353],{"class":188},[159,2664,264],{"class":216},[159,2666,2667],{"class":161,"line":821},[159,2668,824],{"class":363},[159,2670,2671,2673,2675],{"class":161,"line":827},[159,2672,830],{"class":216},[159,2674,765],{"class":256},[159,2676,264],{"class":216},[159,2678,2679,2681,2683],{"class":161,"line":837},[159,2680,840],{"class":216},[159,2682,765],{"class":256},[159,2684,264],{"class":216},[159,2686,2687,2689,2691],{"class":161,"line":847},[159,2688,317],{"class":216},[159,2690,335],{"class":256},[159,2692,264],{"class":216},[59,2694,856,2695,859],{},[71,2696,285],{},[59,2698,862,2699,866],{},[71,2700,865],{},[150,2702,2703],{"className":152,"code":869,"language":154,"meta":155,"style":155},[71,2704,2705],{"__ignoreMap":155},[159,2706,2707,2709,2711,2713,2715,2717,2719,2721,2723,2725,2727,2729,2731,2733,2735],{"class":161,"line":162},[159,2708,166],{"class":165},[159,2710,273],{"class":184},[159,2712,285],{"class":169},[159,2714,278],{"class":184},[159,2716,223],{"class":577},[159,2718,580],{"class":184},[159,2720,699],{"class":169},[159,2722,293],{"class":184},[159,2724,296],{"class":165},[159,2726,894],{"class":180},[159,2728,185],{"class":184},[159,2730,189],{"class":188},[159,2732,193],{"class":192},[159,2734,189],{"class":188},[159,2736,226],{"class":184},[641,2738,908],{"id":907},[59,2740,911,2741,915,2743,726],{},[71,2742,914],{},[71,2744,129],{},[150,2746,2748],{"className":152,"code":920,"highlights":2747,"language":154,"meta":155,"style":155},[314],[71,2749,2750,2782,2792,2803],{"__ignoreMap":155},[159,2751,2752,2754,2756,2758,2760,2762,2764,2766,2768,2770,2772,2774,2776,2778,2780],{"class":161,"line":162},[159,2753,166],{"class":165},[159,2755,273],{"class":184},[159,2757,285],{"class":169},[159,2759,278],{"class":184},[159,2761,223],{"class":577},[159,2763,580],{"class":184},[159,2765,940],{"class":169},[159,2767,293],{"class":184},[159,2769,296],{"class":165},[159,2771,301],{"class":180},[159,2773,185],{"class":184},[159,2775,189],{"class":188},[159,2777,953],{"class":192},[159,2779,189],{"class":188},[159,2781,716],{"class":184},[159,2783,2784,2786,2788,2790],{"class":161,"line":241},[159,2785,723],{"class":722},[159,2787,726],{"class":184},[159,2789,730],{"class":729},[159,2791,733],{"class":184},[159,2793,2795,2797,2799,2801],{"class":2794,"line":314},[161,268],[159,2796,973],{"class":722},[159,2798,726],{"class":184},[159,2800,979],{"class":978},[159,2802,733],{"class":184},[159,2804,2805],{"class":161,"line":324},[159,2806,738],{"class":184},[59,2808,988,2809,991],{},[71,2810,652],{},[993,2812,2813,2817],{},[59,2814,997,2815,1001],{},[71,2816,1000],{},[59,2818,1004,2819,1007,2821,1010,2823,220],{},[71,2820,77],{},[71,2822,223],{},[71,2824,1013],{},[641,2826,1017],{"id":1016},[59,2828,1020,2829,1024],{},[71,2830,1023],{},[150,2832,2834],{"className":237,"code":1027,"filename":239,"highlights":2833,"language":246,"meta":155,"style":155},[314,245,460],[71,2835,2836,2846,2876,2901,2905,2913,2917,2925,2943,2960,2977,2985],{"__ignoreMap":155},[159,2837,2838,2840,2842,2844],{"class":161,"line":162},[159,2839,253],{"class":216},[159,2841,257],{"class":256},[159,2843,261],{"class":260},[159,2845,264],{"class":216},[159,2847,2848,2850,2852,2854,2856,2858,2860,2862,2864,2866,2868,2870,2872,2874],{"class":161,"line":241},[159,2849,166],{"class":165},[159,2851,273],{"class":184},[159,2853,223],{"class":577},[159,2855,580],{"class":184},[159,2857,699],{"class":169},[159,2859,293],{"class":184},[159,2861,296],{"class":165},[159,2863,177],{"class":176},[159,2865,301],{"class":180},[159,2867,185],{"class":184},[159,2869,189],{"class":188},[159,2871,193],{"class":192},[159,2873,189],{"class":188},[159,2875,716],{"class":184},[159,2877,2879,2881,2883,2885,2887,2889,2891,2893,2895,2897,2899],{"class":2878,"line":314},[161,268],[159,2880,1076],{"class":722},[159,2882,726],{"class":184},[159,2884,1081],{"class":184},[159,2886,189],{"class":188},[159,2888,1086],{"class":192},[159,2890,189],{"class":188},[159,2892,1091],{"class":184},[159,2894,1094],{"class":188},[159,2896,1097],{"class":192},[159,2898,189],{"class":188},[159,2900,1102],{"class":184},[159,2902,2903],{"class":161,"line":324},[159,2904,738],{"class":184},[159,2906,2907,2909,2911],{"class":161,"line":330},[159,2908,317],{"class":216},[159,2910,257],{"class":256},[159,2912,264],{"class":216},[159,2914,2915],{"class":161,"line":242},[159,2916,327],{"emptyLinePlaceholder":11},[159,2918,2919,2921,2923],{"class":161,"line":243},[159,2920,253],{"class":216},[159,2922,335],{"class":256},[159,2924,264],{"class":216},[159,2926,2927,2929,2931,2933,2935,2937,2939,2941],{"class":161,"line":244},[159,2928,343],{"class":216},[159,2930,765],{"class":256},[159,2932,807],{"class":260},[159,2934,296],{"class":184},[159,2936,353],{"class":188},[159,2938,814],{"class":192},[159,2940,353],{"class":188},[159,2942,264],{"class":216},[159,2944,2946,2948,2950,2952,2954,2956,2958],{"class":2945,"line":245},[161,268],[159,2947,802],{"class":216},[159,2949,159],{"class":256},[159,2951,360],{"class":216},[159,2953,1156],{"class":363},[159,2955,317],{"class":216},[159,2957,159],{"class":256},[159,2959,264],{"class":216},[159,2961,2963,2965,2967,2969,2971,2973,2975],{"class":2962,"line":460},[161,268],[159,2964,802],{"class":216},[159,2966,159],{"class":256},[159,2968,360],{"class":216},[159,2970,1174],{"class":363},[159,2972,317],{"class":216},[159,2974,159],{"class":256},[159,2976,264],{"class":216},[159,2978,2979,2981,2983],{"class":161,"line":821},[159,2980,840],{"class":216},[159,2982,765],{"class":256},[159,2984,264],{"class":216},[159,2986,2987,2989,2991],{"class":161,"line":827},[159,2988,317],{"class":216},[159,2990,335],{"class":256},[159,2992,264],{"class":216},[59,2994,1199,2995,1203],{},[71,2996,1202],{},[150,2998,3000],{"className":152,"code":1206,"highlights":2999,"language":154,"meta":155,"style":155},[241,314,324],[71,3001,3002,3032,3049,3094,3099],{"__ignoreMap":155},[159,3003,3004,3006,3008,3010,3012,3014,3016,3018,3020,3022,3024,3026,3028,3030],{"class":161,"line":162},[159,3005,166],{"class":165},[159,3007,273],{"class":184},[159,3009,223],{"class":577},[159,3011,580],{"class":184},[159,3013,699],{"class":169},[159,3015,293],{"class":184},[159,3017,296],{"class":165},[159,3019,177],{"class":176},[159,3021,301],{"class":180},[159,3023,185],{"class":184},[159,3025,189],{"class":188},[159,3027,193],{"class":192},[159,3029,189],{"class":188},[159,3031,716],{"class":184},[159,3033,3035,3037,3039,3041,3043,3045,3047],{"class":3034,"line":241},[161,268],[159,3036,1246],{"class":1245},[159,3038,726],{"class":184},[159,3040,1251],{"class":184},[159,3042,699],{"class":206},[159,3044,1256],{"class":184},[159,3046,1259],{"class":165},[159,3048,1262],{"class":184},[159,3050,3052,3054,3056,3058,3060,3062,3064,3066,3068,3070,3072,3074,3076,3078,3080,3082,3084,3086,3088,3090,3092],{"class":3051,"line":314},[161,268],[159,3053,1268],{"class":176},[159,3055,170],{"class":216},[159,3057,220],{"class":184},[159,3059,1275],{"class":180},[159,3061,203],{"class":184},[159,3063,1280],{"class":206},[159,3065,1256],{"class":184},[159,3067,1259],{"class":165},[159,3069,1287],{"class":184},[159,3071,1290],{"class":722},[159,3073,726],{"class":184},[159,3075,1295],{"class":216},[159,3077,220],{"class":184},[159,3079,1300],{"class":216},[159,3081,1091],{"class":184},[159,3083,1305],{"class":722},[159,3085,726],{"class":184},[159,3087,1295],{"class":216},[159,3089,220],{"class":184},[159,3091,1314],{"class":216},[159,3093,1317],{"class":184},[159,3095,3097],{"class":3096,"line":324},[161,268],[159,3098,1323],{"class":184},[159,3100,3101],{"class":161,"line":330},[159,3102,738],{"class":184},[641,3104,1331],{"id":1330},[59,3106,1334,3107,1338,3109,1341],{},[71,3108,1337],{},[71,3110,290],{},[150,3112,3114],{"className":237,"code":1344,"filename":239,"highlights":3113,"language":246,"meta":155,"style":155},[241,244],[71,3115,3116,3126,3165,3173,3177,3185,3193,3209,3236,3244],{"__ignoreMap":155},[159,3117,3118,3120,3122,3124],{"class":161,"line":162},[159,3119,253],{"class":216},[159,3121,257],{"class":256},[159,3123,261],{"class":260},[159,3125,264],{"class":216},[159,3127,3129,3131,3133,3135,3137,3139,3141,3143,3145,3147,3149,3151,3153,3155,3157,3159,3161,3163],{"class":3128,"line":241},[161,268],[159,3130,166],{"class":165},[159,3132,273],{"class":184},[159,3134,223],{"class":169},[159,3136,278],{"class":184},[159,3138,207],{"class":169},[159,3140,278],{"class":184},[159,3142,1337],{"class":169},[159,3144,278],{"class":184},[159,3146,290],{"class":169},[159,3148,293],{"class":184},[159,3150,296],{"class":165},[159,3152,177],{"class":176},[159,3154,301],{"class":180},[159,3156,185],{"class":184},[159,3158,189],{"class":188},[159,3160,193],{"class":192},[159,3162,189],{"class":188},[159,3164,226],{"class":184},[159,3166,3167,3169,3171],{"class":161,"line":314},[159,3168,317],{"class":216},[159,3170,257],{"class":256},[159,3172,264],{"class":216},[159,3174,3175],{"class":161,"line":324},[159,3176,327],{"emptyLinePlaceholder":11},[159,3178,3179,3181,3183],{"class":161,"line":330},[159,3180,253],{"class":216},[159,3182,335],{"class":256},[159,3184,264],{"class":216},[159,3186,3187,3189,3191],{"class":161,"line":242},[159,3188,343],{"class":216},[159,3190,765],{"class":256},[159,3192,264],{"class":216},[159,3194,3195,3197,3199,3201,3203,3205,3207],{"class":161,"line":243},[159,3196,802],{"class":216},[159,3198,59],{"class":256},[159,3200,360],{"class":216},[159,3202,1435],{"class":363},[159,3204,317],{"class":216},[159,3206,59],{"class":256},[159,3208,264],{"class":216},[159,3210,3212,3214,3216,3218,3220,3222,3224,3226,3228,3230,3232,3234],{"class":3211,"line":244},[161,268],[159,3213,802],{"class":216},[159,3215,435],{"class":256},[159,3217,438],{"class":260},[159,3219,296],{"class":184},[159,3221,353],{"class":188},[159,3223,290],{"class":192},[159,3225,353],{"class":188},[159,3227,360],{"class":216},[159,3229,1463],{"class":363},[159,3231,317],{"class":216},[159,3233,435],{"class":256},[159,3235,264],{"class":216},[159,3237,3238,3240,3242],{"class":161,"line":245},[159,3239,840],{"class":216},[159,3241,765],{"class":256},[159,3243,264],{"class":216},[159,3245,3246,3248,3250],{"class":161,"line":460},[159,3247,317],{"class":216},[159,3249,335],{"class":256},[159,3251,264],{"class":216},[59,3253,1488,3254,1491,3256,1494,3258,1498,3260,1502,3262,1505,3264,1509],{},[71,3255,1337],{},[71,3257,290],{},[71,3259,1497],{},[71,3261,1501],{},[71,3263,129],{},[71,3265,1508],{},[59,3267,1512,3268,1516],{},[71,3269,1515],{},[150,3271,3273],{"className":152,"code":1519,"highlights":3272,"language":154,"meta":155,"style":155},[162,324],[71,3274,3275,3292,3296,3330,3343],{"__ignoreMap":155},[159,3276,3278,3280,3282,3284,3286,3288,3290],{"class":3277,"line":162},[161,268],[159,3279,166],{"class":165},[159,3281,1530],{"class":169},[159,3283,173],{"class":165},[159,3285,553],{"class":180},[159,3287,185],{"class":184},[159,3289,1539],{"class":729},[159,3291,226],{"class":184},[159,3293,3294],{"class":161,"line":241},[159,3295,327],{"emptyLinePlaceholder":11},[159,3297,3298,3300,3302,3304,3306,3308,3310,3312,3314,3316,3318,3320,3322,3324,3326,3328],{"class":161,"line":314},[159,3299,166],{"class":165},[159,3301,273],{"class":184},[159,3303,223],{"class":169},[159,3305,278],{"class":184},[159,3307,207],{"class":169},[159,3309,278],{"class":184},[159,3311,290],{"class":169},[159,3313,293],{"class":184},[159,3315,296],{"class":165},[159,3317,177],{"class":176},[159,3319,301],{"class":180},[159,3321,185],{"class":184},[159,3323,189],{"class":188},[159,3325,193],{"class":192},[159,3327,189],{"class":188},[159,3329,716],{"class":184},[159,3331,3333,3335,3337,3339,3341],{"class":3332,"line":324},[161,268],[159,3334,1585],{"class":722},[159,3336,726],{"class":184},[159,3338,1081],{"class":184},[159,3340,1592],{"class":216},[159,3342,1102],{"class":184},[159,3344,3345],{"class":161,"line":330},[159,3346,738],{"class":184},[1600,3348,1603],{"id":1602},[59,3350,1606,3351,1610],{},[71,3352,1609],{},[59,3354,1613],{},[641,3356,1617],{"id":1616},[59,3358,1620,3359,1624],{},[71,3360,1623],{},[150,3362,3364],{"className":152,"code":1627,"highlights":3363,"language":154,"meta":155,"style":155},[162,324],[71,3365,3366,3387,3391,3429,3458],{"__ignoreMap":155},[159,3367,3369,3371,3373,3375,3377,3379,3381,3383,3385],{"class":3368,"line":162},[161,268],[159,3370,166],{"class":165},[159,3372,1638],{"class":169},[159,3374,173],{"class":165},[159,3376,553],{"class":180},[159,3378,185],{"class":184},[159,3380,189],{"class":188},[159,3382,1649],{"class":192},[159,3384,189],{"class":188},[159,3386,226],{"class":184},[159,3388,3389],{"class":161,"line":241},[159,3390,327],{"emptyLinePlaceholder":11},[159,3392,3393,3395,3397,3399,3401,3403,3405,3407,3409,3411,3413,3415,3417,3419,3421,3423,3425,3427],{"class":161,"line":314},[159,3394,166],{"class":165},[159,3396,273],{"class":184},[159,3398,223],{"class":169},[159,3400,278],{"class":184},[159,3402,285],{"class":169},[159,3404,278],{"class":184},[159,3406,207],{"class":169},[159,3408,278],{"class":184},[159,3410,290],{"class":169},[159,3412,293],{"class":184},[159,3414,296],{"class":165},[159,3416,177],{"class":176},[159,3418,301],{"class":180},[159,3420,185],{"class":184},[159,3422,189],{"class":188},[159,3424,193],{"class":192},[159,3426,189],{"class":188},[159,3428,716],{"class":184},[159,3430,3432,3434,3436,3438,3440,3442,3444,3446,3448,3450,3452,3454,3456],{"class":3431,"line":324},[161,268],[159,3433,1701],{"class":722},[159,3435,726],{"class":184},[159,3437,1706],{"class":184},[159,3439,1709],{"class":722},[159,3441,726],{"class":184},[159,3443,1638],{"class":216},[159,3445,1091],{"class":184},[159,3447,1718],{"class":722},[159,3449,726],{"class":184},[159,3451,1094],{"class":188},[159,3453,1725],{"class":192},[159,3455,189],{"class":188},[159,3457,1730],{"class":184},[159,3459,3460],{"class":161,"line":330},[159,3461,738],{"class":184},[59,3463,1737,3464,1741,3467,1747],{},[63,3465,98],{"href":96,"rel":3466},[67],[63,3468,1746],{"href":1744,"rel":3469},[67],[641,3471,1751],{"id":1750},[59,3473,1754],{},[150,3475,3477],{"className":152,"code":1757,"highlights":3476,"language":154,"meta":155,"style":155},[241,314,324,330],[71,3478,3479,3517,3534,3555,3576,3597],{"__ignoreMap":155},[159,3480,3481,3483,3485,3487,3489,3491,3493,3495,3497,3499,3501,3503,3505,3507,3509,3511,3513,3515],{"class":161,"line":162},[159,3482,166],{"class":165},[159,3484,273],{"class":184},[159,3486,223],{"class":169},[159,3488,278],{"class":184},[159,3490,285],{"class":169},[159,3492,278],{"class":184},[159,3494,207],{"class":169},[159,3496,278],{"class":184},[159,3498,290],{"class":169},[159,3500,293],{"class":184},[159,3502,296],{"class":165},[159,3504,177],{"class":176},[159,3506,301],{"class":180},[159,3508,185],{"class":184},[159,3510,189],{"class":188},[159,3512,1795],{"class":192},[159,3514,189],{"class":188},[159,3516,716],{"class":184},[159,3518,3520,3522,3524,3526,3528,3530,3532],{"class":3519,"line":241},[161,268],[159,3521,1805],{"class":1245},[159,3523,1808],{"class":184},[159,3525,1811],{"class":206},[159,3527,1091],{"class":184},[159,3529,1816],{"class":206},[159,3531,1819],{"class":184},[159,3533,1822],{"class":184},[159,3535,3537,3539,3541,3543,3545,3547,3549,3551,3553],{"class":3536,"line":314},[161,268],[159,3538,1828],{"class":1245},[159,3540,1808],{"class":184},[159,3542,1811],{"class":206},[159,3544,1091],{"class":184},[159,3546,1816],{"class":206},[159,3548,1091],{"class":184},[159,3550,217],{"class":206},[159,3552,1819],{"class":184},[159,3554,1822],{"class":184},[159,3556,3558,3560,3562,3564,3566,3568,3570,3572,3574],{"class":3557,"line":324},[161,268],[159,3559,1850],{"class":1245},[159,3561,1808],{"class":184},[159,3563,1811],{"class":206},[159,3565,1091],{"class":184},[159,3567,1859],{"class":206},[159,3569,1091],{"class":184},[159,3571,1816],{"class":206},[159,3573,1819],{"class":184},[159,3575,1822],{"class":184},[159,3577,3579,3581,3583,3585,3587,3589,3591,3593,3595],{"class":3578,"line":330},[161,268],[159,3580,1873],{"class":1245},[159,3582,1808],{"class":184},[159,3584,1811],{"class":206},[159,3586,1091],{"class":184},[159,3588,1859],{"class":206},[159,3590,1091],{"class":184},[159,3592,1816],{"class":206},[159,3594,1819],{"class":184},[159,3596,1822],{"class":184},[159,3598,3599],{"class":161,"line":242},[159,3600,738],{"class":184},[59,3602,1896,3603,1900],{},[63,3604,98],{"href":96,"rel":3605},[67],[87,3607,81],{"id":1903},[59,3609,3610,1908,3612,1911,3614,1915,3616,1919],{},[71,3611,77],{},[71,3613,81],{},[71,3615,1914],{},[71,3617,1918],{},[59,3619,1922,3620,1925,3622,1928],{},[71,3621,77],{},[71,3623,81],{},[150,3625,3626],{"className":152,"code":1931,"language":154,"meta":155,"style":155},[71,3627,3628],{"__ignoreMap":155},[159,3629,3630,3632,3634,3636,3638,3640,3642,3644,3646,3648,3650,3652,3654,3656,3658,3660,3662],{"class":161,"line":162},[159,3631,166],{"class":165},[159,3633,273],{"class":184},[159,3635,223],{"class":169},[159,3637,278],{"class":184},[159,3639,207],{"class":169},[159,3641,293],{"class":184},[159,3643,296],{"class":165},[159,3645,177],{"class":176},[159,3647,1954],{"class":180},[159,3649,185],{"class":184},[159,3651,189],{"class":188},[159,3653,1961],{"class":192},[159,3655,189],{"class":188},[159,3657,1966],{"class":184},[159,3659,213],{"class":165},[159,3661,1971],{"class":180},[159,3663,1974],{"class":184},[59,3665,1977,3666,1980],{},[71,3667,81],{},[1982,3669,3670],{},[59,3671,1986,3672,78,3674,1991],{},[71,3673,81],{},[71,3675,77],{},[59,3677,1994,3678,639],{},[63,3679,638],{"href":1997,"rel":3680},[67],[87,3682,2002],{"id":2001},[59,3684,2005],{},[111,3686,3687,3695,3699],{},[114,3688,504,3689,2012,3691,2015,3693,2018],{},[71,3690,73],{},[71,3692,73],{},[71,3694,81],{},[114,3696,504,3697,2023],{},[71,3698,77],{},[114,3700,2026,3701,2029,3703,220],{},[71,3702,81],{},[71,3704,73],{},[59,3706,2034,3707,2040],{},[63,3708,2039],{"href":2037,"rel":3709},[67],[59,3711,2043,3712,726],{},[63,3713,2048],{"href":2046,"rel":3714},[67],[2050,3716,2052],{},{"title":155,"searchDepth":241,"depth":241,"links":3718},[3719,3720,3729,3730],{"id":89,"depth":241,"text":90},{"id":229,"depth":241,"text":77,"children":3721},[3722,3723,3724,3725,3726,3727,3728],{"id":643,"depth":314,"text":644},{"id":652,"depth":314,"text":653},{"id":907,"depth":314,"text":908},{"id":1016,"depth":314,"text":1017},{"id":1330,"depth":314,"text":1331},{"id":1616,"depth":314,"text":1617},{"id":1750,"depth":314,"text":1751},{"id":1903,"depth":241,"text":81},{"id":2001,"depth":241,"text":2002},{"categories":3732,"date":2073,"readingTime":3733},[2068,2069,2070,2071],{"text":2080,"minutes":2081,"time":2082,"words":2083},{"title":54,"description":2074},{"loc":2078,"lastmod":2073},"keD8WSOOHPrNTJwuhYEJy-lpxfXaPnwq4Kmcc60cAH8",[3738,3742],{"title":3739,"path":3740,"stem":3741,"children":-1},"Lazy Load Vue Component When It Becomes Visible","\u002Fblog\u002Flazy-load-vue-component-when-it-becomes-visible","blog\u002Flazy-load-vue-component-when-it-becomes-visible\u002Findex",{"title":3743,"path":3744,"stem":3745,"children":-1},"What's New in Vue 3.3","\u002Fblog\u002Fwhats-new-in-vue-3-3","blog\u002Fwhats-new-in-vue-3-3\u002Findex",[3747,3752,3757,3762],{"cover":3748,"date":3749,"slug":3750,"title":3751,"to":3750},"blog\u002Fanalyze-memory-leaks-in-your-nuxt-app\u002Fog.png","2024-07-27","\u002Fblog\u002Fanalyze-memory-leaks-in-your-nuxt-app","Analyze Memory Leaks in Your Nuxt App",{"cover":3753,"date":3754,"slug":3755,"title":3756,"to":3755},"blog\u002Fbuilding-a-polite-newsletter-popup-with-nuxt-3\u002FBlog_Post__Polite_Popup_Nuxt_3_k8ch1w.jpg","2022-10-18","\u002Fblog\u002Fbuilding-a-polite-newsletter-popup-with-nuxt-3","Building a Polite Newsletter Popup With Nuxt 3",{"cover":3758,"date":3759,"slug":3760,"title":3761,"to":3760},"blog\u002Fcreate-a-table-of-contents-with-active-states-in-nuxt-3\u002FBlog_Post__ToC_Nuxt_Content_dlbmpz.jpg","2022-12-07","\u002Fblog\u002Fcreate-a-table-of-contents-with-active-states-in-nuxt-3","Create a Table of Contents With Active States in Nuxt 3",{"cover":3763,"date":3764,"slug":3765,"title":3766,"to":3765},"blog\u002Fcreate-an-rss-feed-with-nuxt-3-and-nuxt-content-v2\u002FBlog_Post__Nuxt_Content_v2_RSS_feed_zggann.jpg","2022-08-15","\u002Fblog\u002Fcreate-an-rss-feed-with-nuxt-3-and-nuxt-content-v2","Create an RSS Feed With Nuxt 3 and Nuxt Content v2"]