naive-ui
naive-ui copied to clipboard
在n-space里嵌套n-card循环时会导致页面跳转报错
trafficstars
TuSimple/naive-ui version (版本)
2.33.0
Vue version (Vue 版本)
3.2.37
Browser and its version (浏览器及其版本)
Edge 104.0.1293.54 (正式版本) (64 位)
System and its version (系统及其版本)
windows11
Node version (Node 版本)
Reappearance link (重现链接)
https://codesandbox.io/s/eager-driscoll-r837d1?file=/src/Demo.vue
Reappearance steps (重现步骤)
<n-tabs justify-content="space-evenly" type="line" animated>
<n-tab-pane name="chap2" tab="官方网站">
<div>
<n-space justify="space-between">
<div v-for="(i,index) in linkArray">
<n-card style="text-align:center" :title="i" hoverable @click="goToLink(i.link)">
<n-icon :component="i.component" size="40" :depth="1" :color='i.color'/>
{{i.name}}
</n-card>
</div>
</n-space>
</div>
</n-tab-pane>
<n-tab-pane name="chap1" tab="PA">
<div>
<n-space justify="space-between">
<div v-for="(i,index) in linkArray">
<n-card style="text-align:center" :title="i" hoverable @click="goToLink(i.link)">
<n-icon :component="i.component" size="40" :depth="1" :color='i.color'/>
{{i.name}}
</n-card>
</div>
</n-space>
</div>
</n-tab-pane>
</n-tabs>
</n-card>
Expected results (期望的结果)
正常使用
Actual results (实际的结果)
无法跳转
Remarks (补充说明)
runtime-core.esm-bundler.js:2229
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '__asyncLoader')
我多试了几次组合,发现是n-space里嵌套n-card导致的问题
我看跑的还挺正常的?
已找到问题,已解决,他很有可能是在 setup 中 通过 createDiscreteApi 创建了 loadingBar 导致,改用 useLoadingBar 即可解决
This issue does not have any recent activity. If you are still experiencing similar problems, open a new error, including a minimal copy of the problem