Selaa lähdekoodia

조회 및 css 추가

kiboky 5 vuotta sitten
vanhempi
commit
831f3dae64
3 muutettua tiedostoa jossa 4441 lisäystä ja 6 poistoa
  1. 1 1
      admin/nuxt.config.js
  2. 17 5
      admin/pages/index.vue
  3. 4423 0
      admin/static/css/font-awesome/css/all.css

+ 1 - 1
admin/nuxt.config.js

@@ -13,7 +13,7 @@ export default {
     ],
     link: [
       { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
-      { rel: 'stylesheet',  href: '/css/all.css' },
+      { rel: 'stylesheet',  href: '/css/font-awesome/css/all.css' },
       { rel: 'stylesheet',  href: '/css/default.css' }
     ]
   },

+ 17 - 5
admin/pages/index.vue

@@ -19,16 +19,16 @@
     <!-- Listing Page -->
     <div class="container-fluid browsing-history">
       <div class="row">
-        <div class="col-xl-2 col-lg-2 col-md3 col-sm-6 col-6 br bb">
+        <div v-for="product in products" :key="product._id"  class="col-xl-2 col-lg-2 col-md3 col-sm-6 col-6 br bb">
           <div class="history-box">
             <!-- Product Image -->
             <a href="" class="a-link-normal">
-              <img src="" alt="" class="img-fluid" />
+              <img :src="product.photo" alt="" class="img-fluid" />
             </a>
 
             <div class="a-spacing-top-base asin-title">
               <span class="a-text-normal">
-                <div class="p13n-sc-truncated">Product title</div>
+                <div class="p13n-sc-truncated">{{ product.title }}</div>
               </span>
             </div>
 
@@ -47,7 +47,7 @@
             <!-- Product price -->
             <div class="a-row">
               <span class="a-size-base a-color-price">
-                <span class="p13n-sc-price">$23</span>
+                <span class="p13n-sc-price">{{ product.price }}</span>
               </span>
             </div>
 
@@ -65,7 +65,19 @@
 
 <script>
 
-export default {}
+export default {
+  async asyncData ({ $axios }) {
+    try {
+      let response = await $axios.$get('http://localhost:3000/api/products')
+      console.log(response)
+      return {
+        products: response.products
+      }
+    } catch (err) {
+
+    }
+  }
+}
 </script>
 
 <style>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 4423 - 0
admin/static/css/font-awesome/css/all.css