vue
vue copied to clipboard
Polling doesn't instantiate Vue components.
Hello.
I have some markup similar the example below. Initially our $app variable will not be running and the first instance off spinner in the first conditional will render correctly.
After 10 seconds, our $app will be marked as running, checked via polling, the first <spinner> will be removed and the second <spinner> will be added to the DOM except it isn't converted to the a Vue element, it is rendered in the HTML plain markup as <spinner></spinner>.
I think this may be something to do with Vue elements not instantiating if we are polling on a Livewire component.
Thanks for you time and hope you can help.
<div {{ !$app->isRunning() ? 'wire:poll.10000ms' : ''}}>
@if(!$app->isRunning())
<spinner></spinner>
@endif
@if($app->isRunning())
<spinner></spinner>
@endif
</div>