JavaScript/vue.js/error2
来自康健生活
< JavaScript | vue.js
标题文字
- 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.
- 原因是我在标签中使用了
v-if,同时标签又和其他标签平级 ... <el-button v-if="!userToken" type="primary">+ 关注</el-button> <div class="user-head__follow-box clear-fix"> <div class="tag"> ...
- 这时需要将使用
v-if的标签用一个容器包裹起来(随便什么标签都可以),问题即可解决 ... <el-row> <el-button v-if="!userToken" type="primary">+ 关注</el-button> </el-row> <div class="user-head__follow-box clear-fix"> <div class="tag"> ...
- 原因是我在标签中使用了
- Invalid prop: type check failed for prop "index". Expected String with value "0", got Number with value 0.
- 格式警告,需要字符串,但是传入的是 number 类型数据
No categories