国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

問題記錄:A component with async setup()must be nested in a in order to be rendered.

這篇具有很好參考價值的文章主要介紹了問題記錄:A component with async setup()must be nested in a in order to be rendered.。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

報錯詳情:

setup function returned a promise, but no boundary was found in the parent component tree. A component with async setup() must be nested in a in order to be rendered. 翻譯: setup函數(shù)返回了一個promise,但沒有邊界在父組件樹中找到。 具有異步setup()的組件必須嵌套在中才能呈現(xiàn)。

報錯原因:

如果使用<script setup>,可以在頂部直接使用await,結(jié)果代碼會被編譯成 async setup()。

例如子組件A:

<script setup>
import {getAllFrd} from '@/api/addfriends'
let text = await getAllFrd()
</script >

這樣使用了async setup()的子組件,父組件需要和Suspense配合使用,否則子組件渲染不出來,報錯warn以上內(nèi)容。

解決:

父組件處理:文章來源地址http://www.zghlxwxcb.cn/news/detail-618496.html

<script setup>
import { defineAsyncComponent } from 'vue'
const A = defineAsyncComponent(() =>
  import('@/components/A.vue')
)
// 注意:同一個組件例如A組件,只能用一種引入方式,要么 defineAsyncComponent,要么import,
//不能不同父組件一個import一個defineAsyncComponent,否則打包時粘包
</script >

<template>
  <div class="index">
    <Suspense>
      <template #default>
        <A />
      </template>
    </Suspense>
  </div>
</template>

到了這里,關(guān)于問題記錄:A component with async setup()must be nested in a in order to be rendered.的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔相關(guān)法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • vue3中404頁面顯示問題Catch all routes (“*“) must now be defined using a param with a custom regexp.

    vue3中404頁面顯示問題Catch all routes (“*“) must now be defined using a param with a custom regexp.

    目錄 項目場景:vue3,路由,404頁面 問題描述 原因分析: 解決方案: 使用/:pathMatch(.*)或者/:catchAll(.*) 此圖片用來封面引流的,前面不看都行,解決方案,點我點我 vue3項目中404頁面的顯示 Catch all routes (\\\"*\\\") must now be defined using a param with a custom regexp. 當訪問url時,訪問沒有配置的路由時

    2024年02月15日
    瀏覽(24)
  • Component is not found in path “components/xxx/xxx“ (using by “pages/xxx/xxx“) 問題記錄

    Component is not found in path “components/xxx/xxx“ (using by “pages/xxx/xxx“) 問題記錄

    相信做過小程序的都遇到過Component is not found in path “components/xxx/xxx“ (using by “pages/xxx/xxx“) 這個問題,一般情況的是引用路徑有問題,檢查代碼路徑改對就好了,又或者是 分包 影響的 先說一下我得使用場景,不一定適用于所有人,只是記錄一下我遇到的 1.小程序是分包的

    2024年02月02日
    瀏覽(19)
  • Unity解決動畫不可用:The AnimationClip ‘XXX‘ used by the Animation component ‘XXX‘ must be marked as Legacy.

    Unity解決動畫不可用:The AnimationClip ‘XXX‘ used by the Animation component ‘XXX‘ must be marked as Legacy.

    在Unity 2019.4.38.f1c1以上的版本,創(chuàng)建的創(chuàng)建Animation Clip無法使用,作為組件的默認Clip的話,那么游戲運行的時候這個Clip其實是播不出來的,而且Console會報一條 “The AnimationClip ‘XXX’ used by the Animation component ‘XXX’ must be marked as Legacy.” 的警告信息,以及一條 “Default clip co

    2023年04月08日
    瀏覽(37)
  • Linux服務(wù)器報錯解決The git executable must be specified in one of the following ways: - be included in

    在利用深度學習服務(wù)器,利用Xshell進入端口,想要運行深度學習項目時碰到了以下錯誤: Traceback (most recent call last): ? File \\\"/opt/conda/envs/[yolov5_SE]/lib/python3.9/site-packages/git/__init__.py\\\", line 166, in module ? ? refresh() ? File \\\"/opt/conda/envs/[yolov5_SE]/lib/python3.9/site-packages/git/__init__.py\\\", line

    2024年02月02日
    瀏覽(28)
  • Git報錯fatal: this operation must be run in a work tree

    Git報錯fatal: this operation must be run in a work tree

    學習git在初始化倉庫后查看git狀態(tài)是報錯fatal: this operation must be run in a work tree: 提示:這里描述項目中: 使用git init --bare 進行建立裸倉庫之后,在使用git 其它的命令都會出現(xiàn)fatal:This operation must be run in a work tree 問題,處理方法: 解決方法:在該倉庫目錄下,新建文件夾,

    2024年02月11日
    瀏覽(23)
  • 【React】‘React‘ must be in scope when using JSX react/react-in-jsx-scope

    React 報錯: 意思是在使用 JSX 時,沒有引入 React ,比如像這樣: 在使用 import 引入時,沒有引入 React 。所以在被 Eslint 的 \\\"plugin:react/recommended\\\" 檢查時,就會報錯。 于是很多人就選擇引入的時候加上 React ,這樣 這樣確實不報錯了,但是他們忽略了一個版本事實: 在 React@17

    2024年02月15日
    瀏覽(22)
  • 報錯:Invalid character found in method name. HTTP method names must be tokens

    報錯:Invalid character found in method name. HTTP method names must be tokens

    是我在使用postman去調(diào)用后臺接口時,引發(fā)的錯誤。因為之前還是好好的,這個接口就有問題。那必然是這個接口一些參數(shù)設(shè)置啥的出了問題。 關(guān)于網(wǎng)上有提到的解決方法: Tomcat的header緩沖區(qū)大小不夠,只需要在server.xml中增加maxHttpHeaderSize字段即可 注意你的接口訪問地址是

    2024年02月15日
    瀏覽(30)
  • 踩坑:Invalid character found in method name. HTTP method names must be tokens

    踩坑:Invalid character found in method name. HTTP method names must be tokens

    ? ? ? ? 在進行本地小程序與服務(wù)端請求時,由于加了簽名認證,訪問接口時報錯 Spring boot端 小程序端 ? ?將 https: 更換成 http: 示例: https: //localhost:8080? 改為?? http ://localhost:8080 ? ? ? ssl證書到期了 Tomcat的header緩沖區(qū)大小不夠 參考鏈接 ? ? ? ? ? 3.修改端口號 server.xml中加上

    2024年02月07日
    瀏覽(19)
  • FPGA:調(diào)試報錯Error:add_1 must be in range [-1,DEPTH-1]解決辦法和調(diào)試思路

    FPGA:調(diào)試報錯Error:add_1 must be in range [-1,DEPTH-1]解決辦法和調(diào)試思路

    在進行FPGA調(diào)試的過程中,進行行為仿真,能觀察設(shè)計的邏輯是否正確,通常情況下需要進行run all的運行,這樣才能看到信號在運行過程中的狀態(tài), 在調(diào)試的過程中遇到如下的報錯: 用的是vivado 2019.1聯(lián)合modelism 10.7進行的仿真過程,用vivado內(nèi)置的仿真也是同樣的報錯信息,建

    2024年02月15日
    瀏覽(28)
  • 【報錯】onMounted is called when there is no active component instance too be associated with.

    onMounted is called when there is no active component instance too be associated with.Lifecycle injection APIs can only be used during execytion of setup(), If you are using async setup(),make sure to register lifecycle hooks before the first await statement. 在 import {onMounted } from \\\'vue\\\' 之后使用 使用了Vue3的寫法但并未遵從Vue3的格式 如

    2024年02月12日
    瀏覽(19)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包