Skip to content

Vuex state data is not equal to SSR's data #265

Open
@akagamina

Description

@akagamina

I am using SSR on my project with express.js.

When i request with serverPrefetch on server, response return success, and page is load. but at first, data is not correct showing other or old data.

correct data is updated when the component mounts, but the server-side component not matched to correct data

like this. IMAGE

methods:{ getCompanyProf () { registerStoreModule({ module: companyProfileModule, moduleName: 'companyProfile', store: this.$store }) let paramsArr = this.$route.params.id.split('-') let params = { companyProfileParams: { profileId: paramsArr[paramsArr.length - 1], companyId: paramsArr[paramsArr.length - 2], clientType: 'web', hash: this.$route.query.hash ? this.$route.query.hash : null, isShadow: this.$route.query.isShadow ? 1 : 0 }, companyProfileJobsParams: { profileId: paramsArr[paramsArr.length - 1], companyId: paramsArr[paramsArr.length - 2], pageNumber: 1, pageSize: 9 } } this.$store.dispatch(GET_COMPANY_PROFILE, params.companyProfileParams) } }
serverPrefetch () { this.getCompanyProf()},

I think there is nonsense cache but i dont why? Can you help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions