Skip to content

Instantly share code, notes, and snippets.

@kertnik05
Created July 22, 2020 05:58
Show Gist options
  • Save kertnik05/5d0489780f4623ed814f2d2362859e05 to your computer and use it in GitHub Desktop.
Save kertnik05/5d0489780f4623ed814f2d2362859e05 to your computer and use it in GitHub Desktop.
Vue Coding Challenge 1 Answer
// Add a description to the data object
// with the value "A pair of warm, fuzzy
// socks". Then display the description using
// an expression in an p element, underneath
// the h1.
const app = new Vue({
el: '#app',
data: {
product: 'Socks',
description: 'A pair of warm, fuzzy socks' // my answer to the coding challenge
}
});
<!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>
<style>
</style>
</head>
<body>
<div id="app">
<h1>{{ product }}</h1>
<p>{{ description }}</p> <!-- my answer to the coding challenge -->
</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