From 3c6e81e576546a3bb8d53da85c55202d61bf91a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Mon, 17 May 2021 18:48:21 +0200 Subject: [PATCH] mention Alpine interface --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8fbaefc..6ac795d 100644 --- a/README.md +++ b/README.md @@ -185,13 +185,14 @@ This example uses the Alpine component that we use for search on the [Lean docum resources/js/app.ts ```ts +import { Alpine, component } from '@leanadmin/alpine-typescript'; + declare global { interface Window { - Alpine: any; + Alpine: Alpine; } } -import { component } from '@leanadmin/alpine-typescript'; import Search from './search'; component('search', Search); @@ -202,7 +203,7 @@ import 'alpinejs'; **`app.ts` highlights:** -- It's a good idea to declare the `Alpine` property on `Window` in case you need to use `window.Alpine` +- It's a good idea to declare the `Alpine` property on `Window` in case you need to use `window.Alpine`. The library provides an interface for this. - We initialize each component by calling `component()` - We import Alpine *after* this package