A Pen by Vue Mastery on CodePen.
Created
March 13, 2020 03:03
-
-
Save shixudongleo/7e9768989b6e148f3b79cb1341c553b4 to your computer and use it in GitHub Desktop.
Solution 1 - Intro to Vue
This file contains 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
<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> |
This file contains 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 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