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>use v-if with array length in Vue Js</h2> <p>Print array if array length is greater than zero</p> <button @click="myFunction">Get length</button> <p></p> <p v-if="this.demo.length > 0">Length: {{demo}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ demo:['1','2','3','4'], } }, }).mount('#app') </script> </body> </head> </html>