vuetifyjs / webpack-ssr

Vuetify Webpack SSR Template
https://vuetifyjs.com/overview
62 stars 28 forks source link

can't use synchronous ajax with ssr #18

Closed miyalee closed 7 years ago

miyalee commented 7 years ago

hey there, $ vue init vuetifyjs/webpack-ssr I run this to init a project, I have some code like this:

<span>{{ text || 'abc'}}</span>
......
data() {
    return {
        text: null
    }
},
mounted() {
    $.ajax({
         type: 'get',
         async: false,
         url: '/api/to/url/path',
         success: function(data) {
               if(data.code === 0) {
                    self.text = 'def'
               }
         }
    })
}

then I get a not match warn:

2017-07-11 2 01 41

The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside

, or missing . Bailing hydration and performing full client-side render.

is it not support sync ?

( I think this is a problem of vue-ssr, but I can't found a correct repository )

johnleider commented 7 years ago

Going to need some additional information to address this. Vuetify definitely supports async components and ssr.

johnleider commented 7 years ago

Closing due to inactivity.