Alpine JS is a powerful library to use on your site. On more complex setups you may want to use more than one model in your x-data declaration.
The following code sample shows how you can accomplish this:
<div x-data="{ ...testModel(), ...modelWithParams({ foo: 'bar' }), customLocalVar: 'Foo bar' }">
<!-- Code goes here -->
</div>
Note the use of the spread operator (...) to merge everything into a single object.
Tim Bennett is a web designer and developer. He has a First Class Honours degree in Computing from
Leeds Metropolitan University and currently runs his own one-man web design company, Texelate.