Skip to content

v-bind not update dom in client side when data in client side is different from the server side #10260

Open
@maunier

Description

@maunier

Version

2.6.10

Reproduction link

https://github.com/maunier/nuxt-learning

Steps to reproduce

npm install
npm run dev
http://127.0.0.1:8080/

What is expected?

i expect the div is like this:

<div text="isClient">isClient</div>

What is actually happening?

but now it is:

<div text="isServer">isClient</div>

it is not Nuxt's issue, I have tested in my own vue-ssr server without Nuxt, the problem is exsist still. but the that project is not on the github, so i paste the nuxt project's link here

the core code is like this:

<div :text="text">{{ text }}</div>
data () {
      return {
        text: ''
      }
    },

    created () {
      this.text = Vue.prototype.$isServer ? 'isServer' : 'isClient'
    },

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions