Advertisement
GDolganov

App.Vue

Sep 16th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.17 KB | None | 0 0
  1. <template>
  2.   <div id="app">
  3.     <header>
  4.       <div class="grid">
  5.           <div class="logo">
  6.               <input type='text' placeholder="YouCompany" class="logo">
  7.           </div>
  8.           <div class="nav">
  9.               <router-link class="btn" to="/">Home</router-link>
  10.               <router-link class="btn" :to="{ name: 'table' }">Table</router-link>
  11.               <router-link class="btn" :to="{ name: 'application' }">Apply</router-link>  
  12.           </div>
  13.       </div>
  14.     </header>
  15.     <section class="content">
  16.       <router-view></router-view>
  17.     </section>
  18.     <footer></footer>
  19.   </div>
  20. </template>
  21. <script>
  22. import axios from 'axios'
  23. export default {
  24.    data () {
  25.      return {
  26.        users: [null],
  27.        endpoint: '/src/users.json'
  28.      }
  29.    },
  30.  
  31.    created() {
  32.      this.getAllUsers();
  33.    },
  34.    
  35.  
  36.   methods: {
  37.     getAllUsers() {
  38.       axios.get(this.endpoint)
  39.       .then(respinse => {
  40.         this.users = response.data;
  41.       })
  42.       .catch(error => {
  43.         console.log('-----error-------');
  44.         console.log(error);
  45.       })
  46.     }
  47.   }
  48. }
  49. </script>
  50. <style lang="sass" scoped>
  51. @import 'assets/scss/main.scss';
  52. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement