Skip to content

Instantly share code, notes, and snippets.

@LeanSeverino1022
Created September 6, 2019 03:02
Show Gist options
  • Select an option

  • Save LeanSeverino1022/bfa2913242157b8f4bd08d86f1bfcff2 to your computer and use it in GitHub Desktop.

Select an option

Save LeanSeverino1022/bfa2913242157b8f4bd08d86f1bfcff2 to your computer and use it in GitHub Desktop.
very basics of vue
new Vue({
el: '#app',
data: {
title: 'Go to Facebook',
link: 'http://fb.com',
sampleHtml: '<h2>Sample HTML </h2>'
},
methods: {
changeTitle: function(evt){
this.title = evt.target.value;
}
}
})
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Exercise 1</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
<input type="text" v-on:input="changeTitle" placeholder="enter new title">
<p> {{ title }} - <a :href ="link">Facebook</a> </p>
<p v-html="sampleHtml"> </p>
</div>
<script src="app.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment