首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在每个导航上都要刷新整个应用程序

在每个导航上都要刷新整个应用程序
EN

Stack Overflow用户
提问于 2021-05-09 10:49:53
回答 1查看 510关注 0票数 0

我用strapi和nuxt构建了一个博客。您可以在后端创建一个URL,前端动态地从URL加载当前数据。当我试图加载一个页面时,我会在我的“网络”选项卡中触发一个404错误,但是数据将被加载。

示例页面https://alphaoptik.net/meine-kamera

我的nuxt配置看起来如下:

代码语言:javascript
复制
export default {
    ssr: true, // default value
    // Global page headers: https://go.nuxtjs.dev/config-head

    generate: {
        fallback: true
    },

    loadingIndicator: {
        name: 'folding-cube',
        color: '#E2C994'
    },

    head: {
        title: 'PageSite',
        htmlAttrs: {
            lang: 'de'
        },
        meta: [
            { charset: 'utf-8' },
            { name: 'viewport', content: 'width=device-width, initial-scale=1' },
            { hid: 'description', name: 'description', content: '' }
        ],
        link: [
            { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
        ]
    },

    // Global CSS: https://go.nuxtjs.dev/config-css
    css: [],

    // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
    plugins: [
        { src: '~/plugins/vue-unicons', mode: 'client' }
    ],

    // Auto import components: https://go.nuxtjs.dev/config-components
    components: true,

    // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
    buildModules: [
        // https://go.nuxtjs.dev/typescript
        '@nuxt/typescript-build',
        // https://go.nuxtjs.dev/tailwindcss
        '@nuxtjs/tailwindcss'
    ],

    // Modules: https://go.nuxtjs.dev/config-modules
    modules: [
        '@nuxtjs/apollo',
        '@nuxtjs/cloudinary'
    ],
    
    target: 'static',

    apollo: {
        clientConfigs: {
            default: '@/apollo/config/config.js'
        }
    },

    cloudinary: {
        cloudName: 'cloudName'
    },

    env: {
        strapiBaseUri: process.env.API_URL || "http://localhost:1337"
    },

    // Build Configuration: https://go.nuxtjs.dev/config-build
    build: {}
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-05-11 08:45:59

正如OP所说,答案是用<a> s替换所有的<nuxt-link>标记(在他的情况下,+ SSR和阿波罗预取)。

现在,这并不是做任何艰苦的刷新和正常工作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67456845

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档