Skip to content

Instantly share code, notes, and snippets.

@AlexeyKot
Created August 20, 2017 18:14
Show Gist options
  • Select an option

  • Save AlexeyKot/a3159f4c7321fc022eb70c9f6088d03c to your computer and use it in GitHub Desktop.

Select an option

Save AlexeyKot/a3159f4c7321fc022eb70c9f6088d03c to your computer and use it in GitHub Desktop.

Revisions

  1. AlexeyKot created this gist Aug 20, 2017.
    27 changes: 27 additions & 0 deletions Vue.js computed
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    <!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>