PHP Classes

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

Recommend this page to a friend!
  Classes of Hillary Kollan   Laravel eCommerce with Vue.js   resources/assets/js/components/admin/Main.vue   Download  
File: resources/assets/js/components/admin/Main.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,620 bytes
 

Contents

Class file image Download
<template> <div class="row"> <div class="col-md-4 product-box d-flex align-content-center justify-content-center flex-wrap big-text"> <a href='/admin/orders'>Orders ({{orders.length}})</a> </div> <hr> <div class="col-md-4 product-box d-flex align-content-center justify-content-center flex-wrap big-text"> <a href='/admin/products'>Products ({{products.length}})</a> </div> <div class="col-md-4 product-box d-flex align-content-center justify-content-center flex-wrap big-text"> <a href='/admin/users'>Users ({{users.length}})</a> </div> </div> </template> <script> export default { data() { return { user : null, orders : [], products : [], users : [] } }, mounted() { 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) fetch('/api/products/',{headers:headers}).then(response => response.json()).then(response => this.products = response.data) fetch('/api/orders/',{headers:headers}).then(response => response.json()).then(response => this.orders = response) } } </script> <style scoped> .big-text { font-size: 28px; } .product-box { border: 1px solid #cccccc; padding: 10px 15px; height: 20vh } </style>