I'm wondering if there's a way of use the $nextTick AlpineJS magic property in a javascript script (the "$nextTick" is not recognize):
<div x-data="{ app() }">
<button
@click="updateContent"
x-text="title"
></button>
</div>
...
<script src="{{ asset('js/my_script.js') }}"></script>
my_script.js:
function app() {
return {
title: 'Hello',
updateContent: function() {
title = 'Hello World!';
// $nextTick(() => { console.log($el.innerText) });
// $ is not recognize
}
}
}