index.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <link rel="stylesheet" type="text/css" href="./assets/css/style.css">
  7. <title>Product app</title>
  8. </head>
  9. <body>
  10. <div class="nav-bar"></div>
  11. <div id="app">
  12. <div class="product">
  13. <div class="product-image">
  14. <a :href="link">
  15. <!-- bind the src attribute to the "image" property -->
  16. <img
  17. v-bind:src="image"
  18. :alt="description" :title="description"
  19. /><!-- :attr is shortcut for v-bind:attr -->
  20. </a>
  21. </div>
  22. <div class="product-info">
  23. <h1 v-cloak>{{ product }}</h1>
  24. <h2>Available?</h2>
  25. <p v-cloak v-show="inventory > 10">In stock</p>
  26. <p v-cloak v-show="inventory <= 10 && inventory > 0">Limited stock</p>
  27. <p v-cloak v-show="inventory <= 0">Out of stock</p>
  28. <p v-if="onSale">On sale! Act fast.</p>
  29. <h2>Details</h2>
  30. <ul>
  31. <li v-for="detail in details">{{ detail }}</li>
  32. </ul>
  33. <h2>Colors</h2>
  34. <ul>
  35. <li v-for="variant in variants" v-bind:key="variant.variantId">
  36. {{ variant.variantColor }}
  37. </li>
  38. </ul>
  39. <h2>Sizes</h2>
  40. <ul>
  41. <li v-for="size in sizes" :key="size">{{ size }}</li>
  42. </ul>
  43. </div>
  44. </div>
  45. </div>
  46. <script src="./assets/js/vue.js"></script>
  47. <script src="main.js"></script>
  48. </body>
  49. </html>