Created
July 22, 2020 06:20
-
-
Save kertnik05/3d5014d9ba23c86b5b46c681f4b6b484 to your computer and use it in GitHub Desktop.
Vue Coding Challenge 2 Answer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Add a link to your data object, and use | |
| // v-bind to sync it up with an anchor tag in | |
| // your HTML. Hint: you’ll be binding to the | |
| // href attribute. | |
| const app = new Vue({ | |
| el: '#app', | |
| data: { | |
| product: 'Socks', | |
| description: 'A pair of warm, fuzzy socks', | |
| image: './assets/vmSocks-green-onWhite.jpg', | |
| link: 'somewebsite.com', // my answer to the coding challenge | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Vue Tuts</title> | |
| <link rel="stylesheet" href="./style.css"> | |
| <style> | |
| </style> | |
| </head> | |
| <body> | |
| <div class="nav-bar"></div> | |
| <div id="app"> | |
| <div class="product"> | |
| <div class="product-image"> | |
| <img :src="image" alt=""> | |
| </div> | |
| <div class="product-info"> | |
| <h1>{{ product }}</h1> | |
| <a :href="link" target="_blank">More products like this</a><!-- my answer to the coding challenge --> | |
| </div> | |
| </div> | |
| <p>{{ description }}</p> | |
| </div> | |
| <!-- development version, includes helpful console warnings --> | |
| <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> | |
| <script src="./app.js"></script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment