1、前后端分离式开发,约定好数据字段接口!

2、前端mock静态数据,开发完毕后,与后端进行数据联调!

3、vue.config.js 配置 devServer

 const appData = require('./data.json')
const seller = appData.seller
const goods = appData.goods
const ratings = appData.ratings
module.exports = {
css: {
loaderOptions: {
stylus: {
'resolve url': true,
'import': [
'./src/theme'
]
}
}
},
pluginOptions: {
'cube-ui': {
postCompile: true,
theme: true
}
},
devServer: {
before(app) {
app.get('/api/seller',function(req, res) {
res.json({
errno:0,
success:200,
data:seller
})
})
app.get('/api/goods',function(req, res) {
res.json({
errno:0,
success:200,
data:goods
})
})
app.get('/api/ratings',function(req, res) {
res.json({
errno:0,
success:200,
data:ratings
})
})
},
}
}

4、npm run server 重启服务

5、拿到 seller、goods、ratings 数据

最新文章

  1. MailKit---获取邮件
  2. [转]LUA元表
  3. 第五天:内置对象(7.Javascript内置对象)
  4. Git常用命令总结(超实用)
  5. PostgreSQL删除表
  6. JVM内存堆布局图解分析
  7. Asp.Net MVC4下设置W3P3(IIS)调试步骤
  8. javascript 的对象
  9. VisualC++2012 Compiler Warning C4566
  10. Paint与Canvas的简单用法
  11. JAVA基础知识总结:九
  12. fabric使用
  13. echo的运行
  14. Spring MVC4 + Spring Security4 + Hibernate实例
  15. MySQL数据库基本用法
  16. [转载]WebService服务的三种途径Endpoint Disco WSDL 有什么不同
  17. Eclipse个人规范化设置
  18. Python3基础 time.localtime 当前系统的年月日 时分秒
  19. redis调优
  20. PTHREAD的WINDOWS开发包

热门文章

  1. 源码搭建mysql5.7.20
  2. iOS即时通讯之CocoaAsyncSocket源码解析四
  3. flex 数字上标
  4. js-禁止长页面滚动
  5. 排序算法六:计数排序(Counting sort)
  6. Nginx配置之rewrite、proxy_pass、upstream、location
  7. Mybatis-基本步骤
  8. ./configure 配置文件时出错checking for g++... no
  9. (一:NIO系列)JAVA NIO 简介
  10. JEECG 深度使用培训班 周六周日公开课(一期班)