diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index c24d93e80..f8868d429 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add Apple Silicon hardware detection to `wails doctor`. Changed by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3129) - Remove quarantine attribute on macOS binaries. Changed by @leaanthony in [PR](https://github.com/wailsapp/wails/pull/3118) - Added documentation for a common GStreamer error on Linux systems. Changed by [@mkwsnyder](https://github.com/mkwsnyder) in [PR](https://github.com/wailsapp/wails/pull/3134) +- Added documentation on explicity example of importing JS runtime. Changed by [@danawoodman](https://github.com/danawoodman) in [PR](https://github.com/wailsapp/wails/pull/3178) - Add dock icon right-click exit handling by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3157) ### Fixed diff --git a/website/versioned_docs/version-v2.7.0/reference/runtime/intro.mdx b/website/versioned_docs/version-v2.7.0/reference/runtime/intro.mdx index 3c491ecf0..9174e9f80 100644 --- a/website/versioned_docs/version-v2.7.0/reference/runtime/intro.mdx +++ b/website/versioned_docs/version-v2.7.0/reference/runtime/intro.mdx @@ -34,6 +34,13 @@ The JavaScript library is available to the frontend via the `window.runtime` map mode that provides TypeScript declarations for the runtime. This should be located in the `wailsjs` directory in your frontend directory. +e.g. if you wanted to import the [EventsOn](./events/#eventson) function in your frontend, you can do the following: + +```ts +// src/index.js (for example) +import { EventsOn } from '../wailsjs/runtime' +``` + ### Hide Go: `Hide(ctx context.Context)`