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 toString Method</h2> <p>Convert Array like object to string in Vue js</p> <button @click="addFun">click me</button> <P>Object Property:</P> <p v-for="object in demoObject">{{object}}</p> <p>String: {{result}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ demoObject:[{ s_no:1, title:'Sarkari Naurkri Exams' }, { s_no:2, title:'Font Awesome Icons' }, { s_no:3, title:'Schools Geek' }, { s_no:4, title:'Tutorials Plane' } ], result:'' } }, methods:{ addFun(){ this.result = this.demoObject.map((e) =>e.title).toString(); }, } }).mount('#app') </script> </body> </head> </html>