Question 14
You're building a basic Vue app using Vue 2 via CDN to show a user's login form.
You want to:
- Show a welcome message once the user enters a name and clicks "Login".
- Bind the input using
v-model.
But this code is yet to be tested, you have to test this code and push it to production.
<body>
<div id="app"> <input v-model="username"> <button @click="loggedIn = true">Login</button>
<p v-if="loggedIn"> Welcome, {{ username }}! </p></div>
<script> new Vue({ el: '#app', data: { username: '', loggedIn: false } });</script>
</body></html>Based on the above data, answer the given subquestions.