【问题标题】:Header and Footer load first首先加载页眉和页脚
【发布时间】:2020-04-08 12:38:12
【问题描述】:

为什么首先加载页眉和页脚,然后延迟加载中间内容。这是我的代码。

<template>
  <div>
    <Header />
    <nuxt />
    <upper-footer />
    <Footer />
  </div>
</template>

【问题讨论】:

  • 您如何/在哪里看到加载过程?
  • 好的,但是我看不到源...原因可能是异步操作或...原因可能很多
  • 因为他们肯定做得更少,如果什么都不做的话。
  • @BillalBegueradj 我们可以等待内容加载然后加载页眉和页脚组件吗?
  • 为了确保您可以轻松做到这一点,它被称为条件渲染。

标签: javascript vue.js single-page-application nuxt.js


【解决方案1】:

在 index.vue 中我删除了 &lt;no-ssr&gt;&lt;/no-ssr&gt; 并且它已修复。

之前:

<template>
<no-ssr>
My Content
</no-ssr>
</template>

之后:

<template>
My Content
</template>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-03-08
    • 2012-12-10
    • 1970-01-01
    • 1970-01-01
    • 2012-01-25
    • 2023-03-17
    • 2010-12-03
    • 2012-11-29
    相关资源
    最近更新 更多