Skip to content

Options API Compatibility

The plugin supports both the Composition API and Options API. To enable Options API support:

ts
app.use(install, config, { useOptionsAPI: true })

This will apply a mixin globally to provide access to models via this.$reActiveDatabase in legacy components.

TIP

If you're using only the Composition API, you can omit this flag entirely.

Example (Options API):

js
export default {
  mounted() {
    // Access the database instance
    const db = this.$reActiveDatabase
    // Access a model
    const Task = db.model('task')
    // Query tasks
    Task.all().then(tasks => {
      // ...
    })
  }
}