Help us understand the problem. What is going on with this article?

【Vuetify】NuxtのSSRでVuetifyのDatePickerを使用したら「The client-side rendered virtual DOM tree is not matching server-rendered content. 」というエラー発生

現象

スクリーンショット 2020-05-28 3.51.15.png
SSRでVuetifyのDatePickerを使用したら
[Vue warn]: 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 <p>, or missing <tbody>. Bailing hydration and performing full client-side render.
というエラーが発生

解決策

調べてみると tableにtbodyを入れると解決するとのこと。
https://qiita.com/k5690033/items/d1e436fd3b92fcc1fe61

しかし今回はコンポーネントを丸ごと使用しているためこれができない。

no-ssrを使う

DatePickerに関してはssrする必要がそもそもないので no-ssr で囲って解決した。
https://github.com/nuxt/nuxt.js/issues/1700

    <no-ssr>
      <v-date-picker
        v-model="picker"
        :landscape="landscape"
        :reactive="reactive"
        :full-width="fullWidth"
        :show-current="showCurrent"
        :type="month ? 'month' : 'date'"
        :multiple="multiple"
        :readonly="readonly"
        :disabled="disabled"
        :events="enableEvents ? functionEvents : null"
      ></v-date-picker>
    </no-ssr>
bbapexx
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした