1
0
Fork 0
mirror of https://github.com/archtechx/alpine-typescript.git synced 2025-12-12 06:44:03 +00:00
This commit is contained in:
Samuel Štancl 2021-02-28 16:35:10 +01:00
parent c12e54f4a2
commit 19e75e76ce
2 changed files with 2 additions and 2 deletions

View file

@ -74,7 +74,7 @@ import { component } from '@leanadmin/alpine-typescript';
component('example', ExampleComponent);
```
Which will make it accessible using `Alpine.component('example')('foo', 'bar)`.
Which will make it accessible using `Alpine.component('example')('foo', 'bar')`.
**Note: You may notice that `Alpine.component()` can also be used to register components. However, it's better to avoid using it.** The reason for this is that `window.Alpine` might not yet be accessible when you're registering components, and if it is, it's possible that it's already evaluated some of the `x-data` attributes. `component()` is guaranteed to work. And of course, you can alias the import if you wish to use a different name.