screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> </head> <body> <div id="app"> <h3>Vue Js reverse list in v-for loop</h3> <ul> <li v-for="item in reversedItems" :key="item.id"> {{ item.language }} </li> </ul> </div> <script type="module"> const app = Vue.createApp({ data() { return { items: [ { id: 1, language: 'Vue Js' }, { id: 2, language: 'React' }, { id: 3, language: 'Angular' }, { id: 4, language: 'Javascript' }, ], }; }, computed: { reversedItems() { return this.items.slice().reverse(); }, }, }); app.mount('#app'); </script> </body> </html>