The Delightful World of Vue Part 2
v-model on a Custom Component
  Start your All-Access Pass to unlock this challenge
Buy Access Login

Challenge 1 / 1

We are in the process of building a nice checkout form for our pizza customers. It looks something like this:

<template>
    <form>
        <p>Please, enter your info here:</p>

        <fancy-input
            id="name"
            v-model="client.name"
            label="Name:"
        />
    </form>
</template>

We have just written the first input for the customer's name and we want it to be a custom component. But we've forgotten how to implement v-model in a custom component in Vue 2!

Which of these templates in fancy-input.vue would do the trick, assuming our component has a prop value of type String?

Skip challenges and go to theNext Chapter

Turn Challenges Off?

All further challenges will be skipped automatically.
You can re-enable challenges at any time on this page or from your account page.