# Modules

Druxt : object

The Vue.js Druxt component.

DruxtClient : class

DruxtJS JSON:API client.

DruxtModule : object

The DruxtModule base Vue.js component.

DruxtNuxtModule : function

Nuxt module function to install Druxt.

DruxtStore : object

Vuex store module.

# Druxt : object

The Vue.js Druxt component.

See

Example (Register globally)

import Vue from 'vue'
import { Druxt } from 'druxt'

Vue.component(Druxt)
1
2
3
4

Example (Register locally)

<template>
  <Druxt :module="module" />
</template>

<script>
import { Druxt } from 'druxt'
export default {
  components: { Druxt }
}
</script>
1
2
3
4
5
6
7
8
9
10

# DruxtClient : class

DruxtJS JSON:API client.

See: DruxtClient
Example

import { DruxtClient } from 'druxt'
const druxt = new DruxtClient('https://demo-api.druxtjs.org')
1
2

# DruxtModule : object

The DruxtModule base Vue.js component.

See: API documentation
Example

<script>
import { DruxtModule } from 'druxt'
export default {
  name: 'MyDruxtModule',
  extends: DruxtModule,
  druxt: {
    componentOptions: () => ([['wrapper']]),
    propsData: (ctx) => ({ prop: ctx.prop }),
  }
}
</script>
1
2
3
4
5
6
7
8
9
10
11

# DruxtNuxtModule : function

Nuxt module function to install Druxt.

See: DruxtNuxtModule
Example (nuxt.config.js)

module.exports = {
  modules: [
    'druxt'
  ],
  druxt: {
    baseUrl: 'https://demo-api.druxtjs.org'
  }
}
1
2
3
4
5
6
7
8

# DruxtStore : object

Vuex store module.

See: DruxtStore