screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script type="importmap"> { "imports": { "vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js" } } </script> </head> <body> <div id="app"> <h2>Vue.js array.indexOf() Function</h2> <p>Array:{{countries}}</p> <button @click="findIndex">Find Index of India</button> <p v-if="result">First Index of India is {{ result }}</p> </div> <script type="module"> import { createApp } from 'vue'; createApp({ data() { return { countries: ['Australia', 'England', 'America', 'India', 'China', 'Russia'], result: '' }; }, methods: { findIndex() { this.result = this.countries.indexOf('India'); } } }).mount('#app'); </script> </body> </html>