Skip to content

Instantly share code, notes, and snippets.

@shixudongleo
Created March 13, 2020 03:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shixudongleo/7e9768989b6e148f3b79cb1341c553b4 to your computer and use it in GitHub Desktop.
Save shixudongleo/7e9768989b6e148f3b79cb1341c553b4 to your computer and use it in GitHub Desktop.
Solution 1 - Intro to Vue
<div id="app">
<div class="product-image">
<img src="" />
</div>
<div class="product-info">
<h1>{{ product }}</h1>
<p>{{ description }}</p>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.13/dist/vue.js"></script>
//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.
var app = new Vue({
el: '#app',
data: {
product: 'Socks',
description: 'A pair of warm fuzzy socks'
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment