How to get started with Vue in under a minute?

 How to get started with Vue in under a minute?


0. Open notepad


1.Import Vue

<script src='https://unpkg.com/vue@3'></script>

2.Create a html div to capture the output from Vue

<div id='app'>{{ output }}</div>

3.Create a Vue instance inside script tags and set the data to be returned to the div

<script>

     const vue = Vue.createApp({

         data(){return{output: 'hello world from vue'}}

      })

</script>


4.Mount the instance

      vue.mount('#app')


5. Save the file as index.html and open in browser. That's it.



<script src='https://unpkg.com/vue@3'></script>

<div id='app'>{{ output }}</div>

<script>

     const vue = Vue.createApp({

         data(){return{output: 'hello world from vue'}}

      })

      vue.mount('#app')

</script>




Comments

Popular posts from this blog

aigiri nandini - Brodha V you rock