cms-front
cms-front copied to clipboard
你好,请问一下点击下一页,路由变为https://diamondfsd.com/page/2/ 是怎么设置的?
我写的跳转就一直是 http://localhost:3000/?id=4742 而且没有重新载入的效果 其实我想要实现的也是要做分页 服务端渲染的。不过我不是翻页,而是加载更多的样式,不知道能不能参考你现在分页的代码 让路由变化,然后重新async 获取异步数据 求回复
我目前的博客是基于github pages的,不是用我写的这套系统了哦。 你写的转跳,是不是没有用路由组件来替换a链接
那你的意思是github上的代码实现的不是对应你现在的博客是么?
@k55k32 用了的
component/list.vue
@k55k32 刚刚本地npm run dev你的项目的时候 抛错了诶 vue.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
. Bailing hydration and performing full client-side render. warn @ vue.runtime.esm.js:587 patch @ vue.runtime.esm.js:6107 Vue._update @ vue.runtime.esm.js:2656 updateComponent @ vue.runtime.esm.js:2784 get @ vue.runtime.esm.js:3138 Watcher @ vue.runtime.esm.js:3127 mountComponent @ vue.runtime.esm.js:2791 0.Vue.$mount @ vue.runtime.esm.js:7995 init @ vue.runtime.esm.js:4133 hydrate @ vue.runtime.esm.js:5988 hydrate @ vue.runtime.esm.js:6021 patch @ vue.runtime.esm.js:6103 Vue._update @ vue.runtime.esm.js:2656 updateComponent @ vue.runtime.esm.js:2784 get @ vue.runtime.esm.js:3138 Watcher @ vue.runtime.esm.js:3127 mountComponent @ vue.runtime.esm.js:2791 0.Vue.$mount @ vue.runtime.esm.js:7995 mountApp @ client.js:348 (anonymous) @ client.js:375 Promise.then (async) options.path @ client.js:346 webpack_require @ bootstrap 441715e7ff73b034b602:693 fn @ bootstrap 441715e7ff73b034b602:114 (anonymous) @ nuxt.bundle.js:7973 webpack_require @ bootstrap 441715e7ff73b034b602:693 webpackJsonpCallback @ bootstrap 441715e7ff73b034b602:25 (anonymous) @ nuxt.bundle.js:1 client.js:395 [nuxt.js] Cannot load components TypeError: Cannot read property 'toLowerCase' of undefined at emptyNodeAt (vue.runtime.esm.js:5493) 这是怎么了呀
对 我已经不用我自己写的这个博客了,那个服务器停了,所以迁移了
你这个错误是说服务端和客户端的虚拟dom树不一致,应该是你在哪里错误的使用了 v-if 导致的。
做SSR尽量不要用 v-if ,可以用v-show代替