Created
August 20, 2017 18:14
-
-
Save AlexeyKot/a3159f4c7321fc022eb70c9f6088d03c to your computer and use it in GitHub Desktop.
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> | |
<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