0.22.2 • Published 9 months ago

druxt-views v0.22.2

Weekly downloads
94
License
MIT
Repository
github
Last release
9 months ago

DruxtViews

npm CircleCI Known Vulnerabilities codecov

Drupal Views components for Druxt with support for filters, pagination and sorting.

Links

Install

$ npm install druxt-views

Nuxt.js

Add module to nuxt.config.js

module.exports = {
  modules: [
    'druxt-views'
  ],
  druxt: {
    baseUrl: 'https://demo-api.druxtjs.org',
    views: {
      bundleFilter: true,
      fields: ['title'],
    },
  },
}

Usage

DruxtView component

The DruxtView component uses the JSON:API Views module to render a Decoupled Drupal View.

<DruxtView view-id="frontpage" />

The View can be themed by providing a default scoped slot:

<DruxtView view-id="frontpage">
  <template #default="{ results }">
    {{ results }}
  </template>
</DruxtView>

The component also provides a DruxtWrapper component for theming:

<template>
  <div>
    <slot name="sorts" />
    <slot name="results" />
    <slot name="pager" />
  <div>
</template>

See the DruxtViews API documentation for more information.

Options

Druxt Views options

These options are specific to this module.

OptionTypeRequiredDefaultDescription
views.query.bundleFilterbooleanNofalseWhether to automatically detect Resource types to filter, based on the View bundle filter.
views.query.fieldsstring[]No[]An array of fields to filter from the JSON:API Views Resource types.
views.query.resourceTypesstring[]No[]An array of Resource types to be used by the Fields filter.

Base Druxt options

These options are available to all Druxt modules.

OptionTypeRequiredDefaultDescription
axiosobjectNo{}Axios instance settings.
baseUrlstringYesnullBase URL for the Drupal installation.
0.22.2

9 months ago

0.22.1

10 months ago

0.22.0

10 months ago

0.21.0

1 year ago

0.20.0

2 years ago

0.19.1

2 years ago

0.19.0

2 years ago

0.18.2

2 years ago

0.18.1

2 years ago

0.17.2

2 years ago

0.17.0

2 years ago

0.18.0

2 years ago

0.17.1

2 years ago

0.16.2

2 years ago

0.16.0

2 years ago

0.16.1

2 years ago

0.15.0

3 years ago

0.14.0

3 years ago

0.14.1

3 years ago

0.13.0

3 years ago

0.12.0

3 years ago

0.12.1

3 years ago

0.11.0

3 years ago

0.10.0

3 years ago

0.9.3

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.9.0

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.2

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.1

3 years ago

0.5.0

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago