Vue: Mount a component programmatically (4 lines of code)

preview_player
Показать описание
Jump to 5:05 for the actual code.
This video will show you how to mount a component in Vue programmatically for whatever reason you wanna do that, i explain my case and show you how to do it.

If you have any questions pleas feel free to leave a comment, if you hate the video please dislike, otherwise like.

Cheers.
Рекомендации по теме
Комментарии
Автор

The component doesn't re-render when its props change.

captainalpha
Автор

Thanks for nice explanation. I tried to use your code in my project but get an error:

"[Vue warn]: Error in render: "TypeError: Cannot read properties of undefined (reading 'component')" on the line:




Any suggestion to fix this? (When I include the component directly, it works fine)

RaviTaxali
Автор

What's the advantage over putting the markup in the vue component and just fetching the data? This reminds of the jquery days.

TheMessixaviniesta
Автор

i want the same functionality using vue 3, can you help me please

sakthivelmunusamy
welcome to shbcf.ru