Created
March 15, 2018 07:11
-
-
Save trodzen/d33e525214b7218be44b63af3f97dcaf to your computer and use it in GitHub Desktop.
Vue 2.0 Hello World on a single HTML page.
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
<title>Todd Rodzen</title> | |
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.15/dist/vue.js"></script> | |
<script type="text/javascript"> | |
window.onload=function(){ | |
/* Vue.js code */ | |
new Vue({ | |
el: '#app', | |
data: { | |
message: 'Hello World!' | |
} | |
}); | |
} | |
</script> | |
<!-- hide elements on load --> | |
<style> | |
[v-cloak] { | |
display: none; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="app" v-cloak> | |
<h1>{{ message }}</h1> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment