I have an alert component that I created ... As an example
<AlertComponent message="message" />
I have a method in my main App.vue that will accept a new incoming message object and I would like to create an AlertComponent and add it to the DOM when the message comes in. This is because I may have 1 message or 5 messages so I want to create a component dynamically because once the Component has been added it will display itself for 5 seconds and then remove itself from the view.
I'm unclear how to add a component dynamically to the App.vue dynamically My thought would be to have a div in my templet that I can just "addChild" to or something like that.
What's the recommended Vuejs way of doing this? I didn't want to use a
v-for on an alert component because every time a new message comes in I would have to manage an array of them and I'm sure I would end up with issues with databinding redrawing a component that I've already shown on screen before it has a chance to destroy itself.
I'm looking into this for a go-based site. A couple of possibilities:
If you use one of the systems listed here, you can use your platform to do the magic you need to do for (2). I think that Ruby on Rails, Wordpress, Drupal and a few other popular platforms have this.