import mockdata from "@/scripts/mockdata.js";
引用数据,在你methods里面 直接引用刚刚的mockdata即可。例如:
new Promise((resolve, reject) => {
that.foods =mockdata.data.foods; //直接点出你生成的假数据对象即可
that.foodsListLen = that.foods.length;
}).catch(err=>{
console.log(err)
})
参考
官网地址:https://github.com/nuysoft/Mock/wiki
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持黑区网络。
