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
您可能感興趣的相關文章