vue

test

by evzens

HTML

<script src="https://unpkg.com/vue/dist/vue.js"></script>

<div id="app">
   <!-- 1) Fill the <p> below with your Name and Age - using Interpolation -->
    <p v-model="name">VueJS is pretty cool - YOUR_NAME: {{ name }}  (AGE: {{ age }})</p>
    <!-- 2) Output your age, multiplied by 3 -->
    <p>AGE * 3 :{{ age * 3}} </p>
    <!-- 3) Call a function to output a random float between 0 and 1 (Math.random()) -->
    <p>{{ random() }} </p>
    <!-- 4) Search any image on Google and output it here by binding the "src" attribute -->
    <div>
        <img style="width:100px;height:100px"
        v-bind:src="image">
    </div>
    <!-- 5) Pre-Populate this input with your name (set the "value" attribute) -->
    <div>
        <input type="text" v-bind:value="name">
    </div>
    </div>

JavaScript

new Vue({
el: '#app',
data : {
name: 'Evzen',
age: 65,
image: 'https://www.w3schools.com/howto/img_forest.jpg'
},
methods: {
   random: function() {
   	return Math.random();
   }
}

});