screen_rotation
Copied to Clipboard
<html> <head> <script type="importmap"> { "imports": { "vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js" } } </script> <body> <div id="app"> <h2>Vue js array.valueOf() function from object</h2> <p>Get all property of array of object</p> <button @click='myFunction' class='btn btn-primary'>click me </button> <p></p> <p v-for="result in results">{{result}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ countries:[ { 'countryName':'Australia', 'capitalName':'Canberra' }, { 'countryName':'England', 'capitalName':'London' }, { 'countryName':'India', 'capitalName':'New Delhi' }, ], results : '' } }, methods:{ myFunction(){ this.results = this.countries.valueOf() }, } }).mount('#app') </script> </body> </head> </html>