Vue Dynamic Create Component

Posted on  by admin
Here is the deal;. You are creating a form with a recurring list of fields, for example;.

a list of phone numbers, addresses, tags, names etc.,. a wish list, inputs has search functions embedded with them,.

a todo app maybe? still in 21st century? If you are a JavaScript developer, you’d do;.

Create the template of a single line of the form inputs,.

Put some “add/remove” buttons or icons at the end of the line,.
Jimmy Obonyo AborJimmy Obonyo Abor
6,522
1

Because you have now components, watchers and some other mind-blowing stuff to use, and once you did, you may use again somewhere else. So copy/pasting the snippets, is not just copy/pasting snippets anymore. It’s the time to stop your employer to mock yourself about being copy/pasting employee of the month (or of the year?).

The first thing is to create a reusable component. I’ll make a phone numbers component which I’ll later use inside of my Create Contact page of my application.

But the point is to use the same phone numbers component also inside of Edit Contact page and maybe Show Phone Number page so on.

n1_
3,827