摘要: 使用asyncData就是服务端渲染,computed只是浏览器的渲染刷新会有闪烁 阅读全文
posted @ 2019-04-16 02:09 空瓶子装满了 阅读(600) 评论(0) 推荐(0) 编辑
摘要: //在server/interface/city.js import Router from 'koa-router'; const router = new Router({ prefix:'/city' //给路由添加前缀 }) router.get('/list', async (ctx) => { ctx.body=['北京','天津'] }) export def... 阅读全文
posted @ 2019-04-16 01:35 空瓶子装满了 阅读(794) 评论(0) 推荐(0) 编辑
摘要: layout是页面模板,主要是为了做到无论在任何页面都会显示的内容,例如头部header,或者nav导航,页脚等固定页面。nuxt配置以及layout具体参考(https://cloud.tencent.com/developer/article/1330974) 1.如果项目中存在 layouts 阅读全文
posted @ 2019-04-16 01:15 空瓶子装满了 阅读(1005) 评论(0) 推荐(0) 编辑
摘要: 1.使用 npm 安装 npm install -g vue-cli 2.安装nuxt项目 vue init nuxt-community/koa-template 项目名称 3.如果 vue-cli 没有安装, 需先通过 npm install -g vue-cli 来安装。 4.进入项目npm 阅读全文
posted @ 2019-04-16 01:07 空瓶子装满了 阅读(861) 评论(0) 推荐(0) 编辑