Question 12
Consider the following Vue application with markup “index.html” and javascript file “app.js”.
index.html:
<head> <style> .booked { background-color: red; } </style></head><body> <div id="app"> <button :class="{booked:seat.isBooked}" v-for="seat in seats"> {{seat.seatNo}} </button> </div> <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script> <script src="app.js"></script></body>app.js:
new Vue({ el: '#app', data: { seats: [ { seatNo: 1, isBooked: false }, { seatNo: 2, isBooked: true }, { seatNo: 3, isBooked: true }, ], },})Suppose the application is running on ‘http://localhost:8080’. What will be the background colour of seat with seatNo 1 and 2, respectively, when the user visits the home page of the application (Assume the default background colour of button to be white)?
Red, Red
Red, White
White, White
White, Red