vue-cli-mock
A quick build mock plug-in based on vue-cli3
Last updated 10 months ago by lazipy .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install vue-cli-mock 
SYNC missed versions from official npm registry.

vue-cli-mock

安装

npm install vue-cli-mock -S

使用

vue.config.js

const mock = require('vue-cli-mock')

module.exports = {
  devServer: {
    before (app) {
      mock(app, 'mock')
    }
  }
}

根目录下 mock/user.js

module.exports = {
  'GET /user/login': (req, res) => {
    res.json({ custom: '1111' })
  },
  '/user/1': (req, res) => {
    res.json({ custom: 'response' })
  },
  '/dicts': {
    status: [1, 2, 3]
  }
}

Current Tags

  • 1.1.0                                ...           latest (10 months ago)

17 Versions

  • 1.1.0                                ...           10 months ago
  • 1.0.15                                ...           10 months ago
  • 1.0.14                                ...           10 months ago
  • 1.0.13                                ...           10 months ago
  • 1.0.12                                ...           10 months ago
  • 1.0.11                                ...           10 months ago
  • 1.0.10                                ...           10 months ago
  • 1.0.9                                ...           10 months ago
  • 1.0.8                                ...           10 months ago
  • 1.0.7                                ...           10 months ago
  • 1.0.6                                ...           10 months ago
  • 1.0.5                                ...           10 months ago
  • 1.0.4                                ...           10 months ago
  • 1.0.3                                ...           10 months ago
  • 1.0.2                                ...           10 months ago
  • 1.0.1                                ...           10 months ago
  • 1.0.0                                ...           10 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 0
Last Month 23
Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |