Skip to main content
Not yet stable
@foresightjs/vue is in beta and not yet stable. It works and is fully tested, but the API may still change.
Version: 4.x

Installation

npm version npm downloads

@foresightjs/vue is the official Vue 3 package for ForesightJS. It ships the v-foresight directive for the common case, plus the useForesight and useForesightEvent composables and the Foresight component when you want the element's prediction state.

npm install @foresightjs/vue
# or
pnpm add @foresightjs/vue
# or
yarn add @foresightjs/vue
import { useForesight, vForesight, ForesightManager } from "@foresightjs/vue"

Configuring the manager

You don't have to configure anything. The manager auto-initializes with sensible defaults the first time you register an element.

If you want to tweak global behaviour, call ForesightManager.initialize() once in your main.ts. See Initialize the Manager and Global Settings.

Devtools

The visual Development Tools live in their own package (js.foresight-devtools) and work the same regardless of framework.