1.0.3 • Published 2 years ago

@craydel/craydel-request-document v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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

NameTypeDefaultDescription
show-drawerbooleanfalseControls whether the component is visible or hidden.
hide-overlaybooleanfalseHides the display of the overlay.
document-titlestringfalseSets the header of the drawer to the document title.

Events

NameDescription
hideDrawerEmitted 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
  }
}