Giter VIP home page Giter VIP logo

vue3-ssr's Introduction

vue3-ssr

基于 vue3 的服务端渲染。

vue3-ssr Getting started example.

前置技能

  • vue3
  • axios
  • pinia
  • vue-router
  • express

入口文件

  • dev.server.mjs 开发模式服务(esm模式)

  • prod.server.js 正式环境服务

路由

只有两个页面

  • /ssr/home 基础的ssr,html节点会在服务端创建,但是接口数据还是由客户端渲染

  • /ssr/api 完全体的ssr,html节点同样在服务端渲染,不同的是接口数据可以有选择性的在服务端渲染

onServerPrefetch

onServerPrefetch(): vue3在服务端运行的钩子函数。

注意:index.html 文件遵循严格的代码格式,任意改变可能导致水合异常,务必任意格式化

vue3-ssr's People

Contributors

yu5127627 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

zmyhelloworld

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.