1. 下载安装mockjs
npm i mockjs -D
2. 定义json数据 slide.js
{
"code": 0,
"data": {
"slider": [{
"linkUrl": "http://y.qq.com/m/act/sfhd/262.html?ADTAG=banner&openinqqmusic=1",
"picUrl": "http://y.gtimg.cn/music/common/upload/MUSIC_FOCUS/1354963.jpg",
"id": 21469
}, {
"linkUrl": "https://y.qq.com/m/client/video_set_detail/index.html?id=1738",
"picUrl": "http://y.gtimg.cn/music/common/upload/MUSIC_FOCUS/1355557.jpg",
"id": 21421
}, {
"linkUrl": "https://y.qq.com/m/act/sfhd/264.html?ADTAG=jdt&openinqqmusic=1",
"picUrl": "http://y.gtimg.cn/music/common/upload/MUSIC_FOCUS/1362148.jpg",
"id": 21471
}, {
"linkUrl": "https://y.qq.com/m/act/thebigband/index.html?openinqqmusic=1&ADTAG=jiaodiantu&