Skip to content

Instantly share code, notes, and snippets.

@rdegges
Created July 20, 2017 20:56
Show Gist options
  • Save rdegges/799408f5bc8a406afb2df531337221b7 to your computer and use it in GitHub Desktop.
Save rdegges/799408f5bc8a406afb2df531337221b7 to your computer and use it in GitHub Desktop.
Display a secret message if the correct variable is set in Vue.
<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