Created
July 20, 2017 20:56
-
-
Save rdegges/799408f5bc8a406afb2df531337221b7 to your computer and use it in GitHub Desktop.
Display a secret message if the correct variable is set in Vue.
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
<html> | |
<body> | |
<div id="app"> | |
<h1>{{ message }}</h1> | |
<p v-if="secretMessage">This is a secret HTML element.</p> | |
<p v-else>Welcome to the website.</p> | |
</div> | |
<script src="https://unpkg.com/vue"></script> | |
<script> | |
let app = new Vue({ | |
el: "#app", | |
data: { | |
message: "Hi!", | |
secretMessage: false | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment