4

I have follow code that should fetch data asynchrony:

  methods : {
    btn() {
      console.log("Hello");
      var url = "https://jsonplaceholder.typicode.com/users";
      let mydata = await fetch(url);
      console.log(mydata);
    }
  }

And I am getting error: Module build failed: SyntaxError: D:/app3/src/App.vue: await is a reserved word (19:19)

Jonatas Walker
  • 13,583
  • 5
  • 53
  • 82
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145

0 Answers0