Giter VIP home page Giter VIP logo

extract-form-component-1's Introduction

difficulty training chapter tags
1
true
Chapter 2: Vue.js Components
vue

Extract Form Component

Challenge Description

Now that we know how to extract a component, let's go a little bit further and extract the form to its own component. We will do similar to the last coding challenge, extracting the template and the logic for creating and editing a movie.

  • Create a MovieForm.vue component.
  • Move the template for a movie form into the MovieForm.vue component.
  • Move the logic for validation into the MovieForm.vue component.
  • Listen to custom events for that component.

Requirements

  • Move the current template for the form into the MovieForm.vue component.
  • Replace the current part of our template where the form is displayed, with the MovieForm.vue component
  • The MovieForm.vue component should have the following props:
    • modelValue: It should receive the movie object, it should be optional.
  • Create 2 custom events in the MovieForm.vue component.
    • update:modelValue: Should be dispatched when the user clicks the save button and include the form as the payload
    • cancel: Should be dispatched when the user clicks the cancel button and requires no payload.
  • The rest of our application functionality should still work as expected.

Other Considerations

  • If you see the data-test attribute anywhere in the boilerplate don't remove it.
  • TailwindCSS is preinstalled with the default config. It might be helpful for you, if you want to have some styles. (Not obligatory)

Example of finished App

This is an example of what the functionality should look like for the completed exercise. If you’d like to mimic this style, feel free to do so, but it is not required.

Finished app in this challenge

extract-form-component-1's People

Contributors

hasunnilupul avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.