PHP Classes

File: resources/assets/js/components/admin/Users.vue

Recommend this page to a friend!
  Classes of Hillary Kollan   Laravel eCommerce with Vue.js   resources/assets/js/components/admin/Users.vue   Download  
File: resources/assets/js/components/admin/Users.vue
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Laravel eCommerce with Vue.js
Implementation of an interactive eCommerce site
Author: By
Last change:
Date: 2 years ago
Size: 1,171 bytes
 

Contents

Class file image Download
<template> <div> <table class="table table-responsive table-striped"> <thead> <tr> <td></td> <td>Name</td> <td>Email</td> <td>Joined</td> <td>Total Orders</td> </tr> </thead> <tbody> <tr v-for="(user,index) in users" @key="index"> <td>{{index+1}}</td> <td>{{user.name}}</td> <td>{{user.email}}</td> <td>{{user.created_at}}</td> <td>{{user.relationship.orders.length}}</td> </tr> </tbody> </table> </div> </template> <script> export default { data() { return { users : [] } }, beforeMount() { let headers = { "Content-Type":"application/json", "Authorization":"Bearer " + localStorage.getItem('sellify.jwt') }; fetch('/api/users', {headers:headers}).then(response => response.json()).then(response => this.users = response.data) } } </script>