Skip to content

Instantly share code, notes, and snippets.

@trodzen
Created March 15, 2018 07:11
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 trodzen/d33e525214b7218be44b63af3f97dcaf to your computer and use it in GitHub Desktop.
Save trodzen/d33e525214b7218be44b63af3f97dcaf to your computer and use it in GitHub Desktop.
Vue 2.0 Hello World on a single HTML page.
<!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