@craydel/craydel-request-document

1.0.3 • Public • Published

CraydelRequestDocument

Installation

Get the latest version by NPM:

$ npm i @craydel/craydel-reuqest-document

Register Plugin

If you use the plugin API, the component will be registered as a global component just like when including it with the script tag, but you won't need to re-register it through the components property in your own components.

Create the plugin file e.g craydel-components.js file.

// craydel-components.js
import Vue from 'vue'
import CraydelRequestDocument from '@craydel/craydel-request-document/src/CraydelRequestDocument.vue'

const Components = {
  CraydelRequestDocument,
};

Object.keys(Components).forEach(name => {
  Vue.component(name, Components[name]);
});

export default Components;

Next reference the plugin file in your nuxt.config.js

// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
  '~/plugins/craydel-components.js'
]

Props

Name Type Default Description
show-drawer boolean false Controls whether the component is visible or hidden.
hide-overlay boolean false Hides the display of the overlay.
document-title string false Sets the header of the drawer to the document title.

Events

Name Description
hideDrawer Emitted when the drawer is closed.

Usage

An example showing a drawer to request a Birth Certificate.

<v-btn @click="show_drawer = true">Request birth certificate</v-btn>

<craydel-request-document
        :show-drawer="show_drawer"
        @hideDrawer="show_drawer = false"
        document-title="Birth Certificate"
></craydel-request-document>
data() {
  return {
    show_drawer: false
  }
}

Package Sidebar

Install

npm i @craydel/craydel-request-document

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

8.37 kB

Total Files

5

Last publish

Collaborators

  • sayedwasim