会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
空瓶子装满了
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
下一页
2019年4月17日
nuxt2.0项目创建(最新)
摘要: 使用import需要babel编译写法如下 项目中使用sass 辅助工具安装 MongoDB(http://www.runoob.com/mongodb/mongodb-window-install.html) redis(http://www.runoob.com/redis/redis-inst
阅读全文
posted @ 2019-04-17 00:22 空瓶子装满了
阅读(674)
评论(0)
推荐(0)
2019年4月16日
nuxt服务端渲染
摘要: 使用asyncData就是服务端渲染,computed只是浏览器的渲染刷新会有闪烁
阅读全文
posted @ 2019-04-16 02:09 空瓶子装满了
阅读(612)
评论(0)
推荐(0)
nuxt写路由接口
摘要: //在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 空瓶子装满了
阅读(806)
评论(0)
推荐(0)
next中layout
摘要: layout是页面模板,主要是为了做到无论在任何页面都会显示的内容,例如头部header,或者nav导航,页脚等固定页面。nuxt配置以及layout具体参考(https://cloud.tencent.com/developer/article/1330974) 1.如果项目中存在 layouts
阅读全文
posted @ 2019-04-16 01:15 空瓶子装满了
阅读(1026)
评论(0)
推荐(0)
nuxt创建项目
摘要: 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 空瓶子装满了
阅读(866)
评论(0)
推荐(0)
2019年4月14日
koa路由接口
摘要: const router = require('koa-router')() //返回一个页面 router.get('/', async (ctx, next) => { global.console.log('index11111'); await ctx.render('index', { //render返回一个页面 title: 'Hello Koa 2!' ...
阅读全文
posted @ 2019-04-14 03:59 空瓶子装满了
阅读(283)
评论(0)
推荐(0)
koa中间件
摘要: function pv(ctx){ global.console.log(ctx.path); } module.exports=function(){ return async function(ctx,next){ pv(ctx); await next(); //next是继续执行下面的中间件,如果不写会直接跳出,不会继续执行 } ...
阅读全文
posted @ 2019-04-14 03:41 空瓶子装满了
阅读(162)
评论(0)
推荐(0)
2019年4月12日
新建koa2项目
摘要: 1.npm install -g koa-generator 2.koa2 项目名称,如果需要ejs引擎koa2 -e 项目名称 3.cd 项目名称 4.npm install 5.npm install --update-binary 6.npm run dev 小知识点:对于start和test
阅读全文
posted @ 2019-04-12 23:01 空瓶子装满了
阅读(558)
评论(0)
推荐(0)
vue中自定义属性
摘要: //v-bind:id="变量" or :id="变量"
阅读全文
posted @ 2019-04-12 00:51 空瓶子装满了
阅读(2817)
评论(0)
推荐(0)
vue将HTML字符串解析为HTML标签
摘要: 如果返回的数据是html标签字符串的话,在vue里要通过v-html来渲染
阅读全文
posted @ 2019-04-12 00:39 空瓶子装满了
阅读(20959)
评论(0)
推荐(3)
上一页
1
2
3
4
5
6
7
下一页
公告