• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: How to add multiple components dynamically at run time not globally but locally

Resolved: How to add multiple components dynamically at run time not globally but locally

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

Hi i have a situation where i need to register multiple components at run time within a file.
Display.vue
in my above file how i want my components to be loaded something like shown below:
here is how i’m dispatching event to above file Display.vue
Execution sequence:
  1. event dispatch component-ready
  2. eventlisterner in created of file Display.vue will call load method

Problem: in my current approach components are registered globally, that i want to avoid. i want to register all components to Display.vue file only

Answer:

To locally register the components on the fly, you can copy the component definitions into this.$options.components:
demo

If you have better answer, please add a comment about this, thank you!

javascript vue-component vue.js vuejs2
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Passing 2 functions in onChange in react

24/03/2023

Resolved: Why doesn’t stringstream consume output during hex formatting?

24/03/2023

Resolved: CMake path for python3 libraries doesn’t change (windows 10)

24/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.