error content:
F:nuxtnuxt-appuk-uinode_modules_vue@2.5.16@vuedistvue.runtime.esm.js:587 [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
, or missing
< tbody >. Bailing hydration and performing full client-side render.
-sharp-sharp
refresh the interface directly will not report an error, that is, if you jump back to the current home page after login, you will report this error. The
code snippet is as follows.
//css
css: [
{ "src": "~/assets/css/base.scss", lang: "scss" },
"element-ui/lib/theme-chalk/index.css",
],
//
loading: { color: "-sharp3B8070" },
//
plugins: [
{ src: "~/plugins/config" },
{ src: "~/plugins/token" },
{ src: "~/plugins/http" },
{ src: "~/plugins/element-ui", ssr: true },
{ src: "~/plugins/swiper" },
],
//
srcDir: "src/",
// vendor.bundle.js
build: {
vendor: [
"axios",
"~/plugins/element-ui",
"~/plugins/swiper",
"~/plugins/config",
"~/plugins/crypto",
"~/plugins/http",
"~/plugins/token",
"~/plugins/utils",
"~/plugins/validate"
],
Code handling:
beforeMount: function() {
var _this = this;
var init = getSession("init");
if (init == null || init == undefined || init == "") {
http.get("login/is-login").then(function(res) {
setStore("islogin", res.islogin);
setSession("init", 1);
if (res.islogin == 1) {
debugger;
var strPhone = _this.$store.state.user.phone;
_this.isLoginNo = true;
}
});
} else {
var islogin = getStore("islogin");
if (islogin == 1) {
debugger;
_this.isLoginNo = true;
var userinfo = getStore("userinfo");
_this.$store.commit("user/SET_LOGIN");
_this.$store.commit("user/SET_USER", userinfo);
var strPhone = _this.$store.state.user.phone;
}
}
},
if islogin = = 1 is the login status locally, only this warning is reported. It"s no problem running the project. But after webpack packed online. Another error will be reported after logging in. The program completely crashed. It is good before login, and the error after login is as follows:
ask everyone why.