Question 21
Consider the following Vue.js 2 component using CDN.
<div id="app"> <input v-model="newItem" placeholder="Add an item" /> <button @click="addItem">Add</button>
<ul> <li v-for="(item, index) in items" :key="index"> {{ index + 1 }}. {{ item }} </li> </ul></div>
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script><script> new Vue({ el: '#app', data: { newItem: '', items: ['Apple', 'Banana'] }, methods: { addItem() { if (this.newItem) { this.items.push(this.newItem, this.newItem); this.newItem = ''; } } } });</script>After entering "Orange" in the input box and clicking the "Add" button, what will be seen in the browser?
1. Apple
2. Banana
3. Orange
4. Orange1. Apple
2. Banana
3. Orange1. Apple
2. Banana
3. Orange
3. Orange1. Apple
2. Banana