Answers for "vuejs read json file"

1

vuejs read json file

<template>
  <div id="app">
    <ul>
      <li v-for="user in users" :key="user.id">
         {{user.name}}
       </li>
    </ul>
  </div>
</template>

<script>
import usersData from "./users.json";

export default {
  data() {
    return {
      users: usersData,
    };
  },
};
</script>
Posted by: Guest on September-15-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language