使用 Vue 2.0 實現服務端渲染的 HackerNews


  Vue 2.0 支持服務端渲染 (SSR),並且是流式的,可以做組件級的緩存,這使得極速渲染成為可能。同時, 和 2.0 也都能夠配合 SSR 提供同構路由和客戶端 state hydration。vue-hackernews-2.0 是 Vue 作者在GitHub上面放的 Vue 2.0 的一個示例項目,結合 Express、vue-router & vuex 來構建,是很好的學習案例。

Features

  • Server Side Rendering
    • Vue + vue-router + vuex working together
    • Server-side data pre-fetching
    • Client-side state & DOM hydration
  • Single-file Vue Components
    • Hot-reload in development
    • CSS extraction for production
  • Real-time List Updates with FLIP Animation

Architecture Overview

Build Setup

Requires Node.js 6+

# install dependencies
npm install

# serve in dev mode, with hot reload at localhost:8080
npm run dev

# build for production
npm run build

# serve in production mode
npm start

  

您可能感興趣的相關文章

 

原文鏈接:新手入門指導:Vue 2.0 的建議學習順序

編譯來源:夢想天空 ◆ 關注前端開發技術 ◆ 分享網頁設計資源


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM