You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of defining nested components in conding-time:
importTestfrom'./Test.html';exportdefault{components: {
Test
}}
Is it possible to add a new component to the components object in run-time? I'm getting the code of the new component via ajax, and this component was already compiled by Svelte with 'eval' format.
The problem is visibility
I'm am unable to access the components object using the variable of my main app, to add new components loaded in run-time.
For example, a console.log( app.components ) from a compiled and running app returns undefined:
This is not currently directly supported - There is an issue for it, #640
One workaround would be to manually instantiate the new child component, with a target: of some ref in the parent component. You would then need to make sure you manually destroyed the child component when the parent component is destroyed.
Instead of defining nested components in conding-time:
Is it possible to add a new component to the
components
object in run-time? I'm getting the code of the new component via ajax, and this component was already compiled by Svelte with'eval'
format.The problem is visibility
I'm am unable to access the
components
object using the variable of my main app, to add new components loaded in run-time.For example, a
console.log( app.components )
from a compiled and runningapp
returnsundefined
:The text was updated successfully, but these errors were encountered: