All files / vue-koa-demo/src mock.js

0% Statements 0/4
100% Branches 0/0
100% Functions 0/0
0% Lines 0/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17                                 
const Mock = require('mockjs')
const Random = Mock.Random
const template = {
  'todoList|4-8': [{
    id: Random.integer(1, 100),
    state: Random.pick(['todo', 'done']),
    time: Random.datetime('yyyy-MM-dd A HH:mm:ss'),
    detail: Random.sentence(20, 40)
  }, {
    id: Random.integer(1, 100),
    state: Random.pick(['todo', 'done']),
    time: Random.datetime('yyyy-MM-dd A HH:mm:ss'),
    detail: Random.sentence(20, 40)
  }]
}
Mock.mock(/\/api\/todolist/, 'get', template)