1
0
Fork 0
mirror of https://github.com/archtechx/alpine-typescript.git synced 2025-12-12 06:44:03 +00:00

Improve IDE support, addTitles()

This commit is contained in:
Samuel Štancl 2021-03-09 20:06:40 +01:00
parent 19e75e76ce
commit 644fd0524f
2 changed files with 21 additions and 1 deletions

View file

@ -34,6 +34,14 @@ import { bootstrap } from '@leanadmin/alpine-typescript';
bootstrap();
```
Additionally, you can use the `addTitles()` function to add `x-title` attributes to all components. The class name of each component will be used as its title. This is useful if you're using tools like the [Alpine.js devtools](https://github.com/alpine-collective/alpinejs-devtools).
```ts
import { addTitles } from '@leanadmin/alpine-typescript';
addTitles();
```
## Usage
You can use a component by calling `Alpine.component('componentName')(arg1, arg2)`. If your component has no arguments, still append `()` at the end of the call.