mirror of
https://github.com/archtechx/alpine-typescript.git
synced 2025-12-11 22:34:03 +00:00
syntax improvements in examples
This commit is contained in:
parent
a92f6f76e0
commit
8464174774
1 changed files with 3 additions and 3 deletions
|
|
@ -6,7 +6,7 @@ It's used like this:
|
|||
|
||||
**Register a component**
|
||||
```ts
|
||||
import { DarkModeToggle } from './darkModeToggle';
|
||||
import DarkModeToggle from './darkModeToggle';
|
||||
|
||||
Alpine.component('darkModeToggle', DarkModeToggle);
|
||||
```
|
||||
|
|
@ -68,7 +68,7 @@ In the context of plain objects, the wrapper function acts as a constructor that
|
|||
|
||||
A component can be registered like this:
|
||||
```ts
|
||||
import { ExampleComponent } from './ExampleComponent';
|
||||
import ExampleComponent from './ExampleComponent';
|
||||
import { component } from '@leanadmin/alpine-typescript';
|
||||
|
||||
component('example', ExampleComponent);
|
||||
|
|
@ -270,7 +270,7 @@ export default class Search extends AlpineComponent {
|
|||
return this.$refs.results.children[index + 1] as HTMLElement;
|
||||
};
|
||||
|
||||
currentResult(): HTMLElement {
|
||||
currentResult(): HTMLElement|null {
|
||||
if (! this.$refs.results.contains(document.activeElement)) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue