vue 静态框架
令 (ream)
Framework for building universal web app and static website in Vue.js.
在Vue.js中构建通用Web应用程序和静态网站的框架。
Server-side rendered Vue.js app should be made easy, since vue-router is well optimized for SSR, we built ream on the top of it to make you build universal Vue.js app fast with fewer trade-offs, the only requirement is to export router instance in your entry file, which means you have full control of vue-router as well!
应该简化服务器端渲染的Vue.js应用程序,因为vue-router已针对SSR进行了优化,因此我们在其上构建了ream,以使您能够以较少的权衡而快速构建通用的Vue.js应用程序,这是唯一的要求是在您的入口文件中导出路由器实例,这意味着您也完全控制vue-router!
特征 (Features)
Server-side rendering with code-split support
Extensible webpack config
Plugin system
Next.js/Nuxt.js-like behavior via plugin
Generate static website
Writing blogs using Markdown/Vue Component
Exposed a fluent API
安装 (Install)
yarn add ream
用法 (Usage)
Unlike a regular Vue SPA, you must export a router
function in your app entry in order to make it work with Ream:
与常规Vue SPA不同,您必须在应用程序条目中导出router
功能才能使其与Ream一起使用:
// index.js
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
export default {
router() {
return new Router({
mode: 'history',
routes: [{
path: '/',
// Dynamically load your index component
component: () => import('./index.vue')
}]
})
}
}
And that's it, run ream dev
and have fun playing your app at http://localhost:4000
.
就是这样,运行ream dev
并在http://localhost:4000
玩您的应用程序很有趣。
路线图 (Roadmap)
[ ] Prefetch data for route components.
[]预取路由组件的数据。
[ ] Document how to modify internal webpack config.
[]记录如何修改内部webpack配置。
[ ] Documentation website.
[]文档网站。
[ ] Add proper tests.
[]添加适当的测试。
To make things happen faster, you may consider becoming a patron to support the development:
为了使事情更快地发生,您可以考虑成为支持开发的赞助人:
翻译自: https://vuejsexamples.com/framework-for-building-universal-web-app-and-static-website-in-vue-js/
vue 静态框架