Giter VIP home page Giter VIP logo

Comments (3)

lzxb avatar lzxb commented on July 30, 2024

第一点:
服务端无法读取 localStorage,只能在 mounted 钩子中读取,然后显示在页面上

第二点:
假设你使用 express ,可以编写 express 中间件,处理重定向的逻辑

第三点:
可以通过 process.env.VUE_ENV === 'client'process.env.VUE_ENV === 'server' 来判断客户端和服务端的处理逻辑

from gez.

dehyang avatar dehyang commented on July 30, 2024

第一点:
服务端无法读取 localStorage,只能在 mounted 钩子中读取,然后显示在页面上

第二点:
假设你使用 express ,可以编写 express 中间件,处理重定向的逻辑

第三点:
可以通过 process.env.VUE_ENV === 'client'process.env.VUE_ENV === 'server' 来判断客户端和服务端的处理逻辑

谢谢。。我也第一次搞这个。。最终我才发现大家都是基于 vue-server-renderer。。所以很多知识点是vue-server-renderer的。

我也重新看了一遍 vue-server-renderer ,确实解决很多问题。

我这反而有一点推荐,就是在文档前描述增加点 vue-server-renderer 介绍,能帮助不少新人吧!!比如我!苦笑!

from gez.

lzxb avatar lzxb commented on July 30, 2024

你可以提交个PR过来我来更新一下。

from gez.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.