React simulates mock

I used mock to simulate a piece of data
let list = Mock.mock ("/ pie", {

)
moni:{
    salesTypeData:[
        {
          x: 0,
          y: "2018-5-10",
        },
        {
          x: 20,
          y: "2018-5-11",
        },
        {
          x: 40,
          y: "2018-5-12",
        },
        {
          x: 60,
          y: "2018-5-13",
        },
        {
          x: 80,
          y: "2018-5-14",
        },
        {
          x: 100,
          y: "2018-5-15",
        },
        {
            x: 120,
            y: "2018-5-16",
          },
      ]
}
 

})

export default {

list,

};
I don"t know if this is the right way to write it

clipboard.png
fetch
undefined
clipboard.png


module.exports = {
  code: "0", //0
  msg: "success",
  data: {
      ...   
  }
};

but it is recommended to use remote, after all, everyone can use it. https://easy-mock.com/login


mockjs does not support fetch,. You can use other ajax such as jquery's ajax to access it

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b225b2-4e277.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b225b2-4e277.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?