Skip to content

Instantly share code, notes, and snippets.

@AlexeyKot
Created August 20, 2017 18:14
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 AlexeyKot/a3159f4c7321fc022eb70c9f6088d03c to your computer and use it in GitHub Desktop.
Save AlexeyKot/a3159f4c7321fc022eb70c9f6088d03c to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Computed Property</title>
</head>
<body>
<div id="app">
<h1>Ваш возраст</h1>
<input v-model="age" type="text">
<a v-if="age18" id="_14" href="#">Перейдите  по ссылке</a>
</div>
</body>
<script src="https://vuejs.org/js/vue.js"></script>
<script>
new Vue({
el: '#app',
data: {
age: ""
},
computed: {
age18: function () {
return this.age == "18"
}
}
})
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment