3 Program to demonstrate Data-Binding in VueJS

Program:

index.html:

<!DOCTYPE html>

<html>



<body>

    <div id="ad">

        {{ message }}

        <br>

        <img v-bind:src="path">

        <br>

        <a v-bind:href="link"> CodingAtharva Link </a>

    </div>



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

    <script type="text/javascript" src="./index.js"> </script>



</body>



</html>


index.js:

var app = new Vue({

    el: '#ad',



    data: {

        message: 'Image',

        path: 'https://images.unsplash.com/photo-1596775631931-89aa30f892c7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60',

        link: 'https://codingatharva.blogspot.com/',

    },

});


Output:
Data-Binding in VueJS

Previous
Next Post »