Dynamic Modal Content With Vue.js

Posted 2 years ago by Craytor

I'm trying to integrate dynamic modals within my application. For example, I have a table of data, and I have a button that is "edit content". In a perfect world a modal would pop up and there would be the data from the selected row in the modal in a fashion that would make logical sense. The title would be the modal title, the description would be editable, and there would be a submit button.

Is there such a way that you could only have one modal (so you don't have to have x amount of modals when you have x rows in the table), and the change out the content when you change the content? Also is there a way to send data back to the parent component? Should the modal be a component? If so, how would I go about doing this?

Any help would be greatly appreciated!

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.