4.0.0 • Published 6 years ago

@decision6/formly-modal v4.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

formly modal

A wrapper for Quasar QModal by using QFormly

Requirements

This package has as a dependencies:

  • Vue 2.5.x
  • Quasar 14.x
  • VueFormlyQuasar 2.x

Install

yarn add @decision6/formly-modal

Usage

This package exports a single component, FormlyModal. An example of use:

import FormlyModal from '@decision6/formly-modal'

export default {
  components: {
    FormlyModal
  }
}

<template>
  <FormlyModal />
</template>

FormlyModal component

Properties

PropertyTypeRequiredDefaultDescription
modelObjectyesForm model
fieldsArraynoAn array of objects with each field on your form.
fieldsGroupArraynoAn array of objects to multicolumn form. See the section Multicolumns Form to more details
titleStringyesModal title
sizeStringnosmA size to modal. Accepts the following values: sm, lg, xlg, 2xlg
heightNumberno550An specific height to modal
toolbarColorStringnoprimaryA color option from Quasar Collor Pallete
forceLoadingBooleannofalseForce loading state inside modal. This is useful when await async data to inside modal

Vue Events

Vue EventDescriptionPayload
@saveEmitted when save button is clickedA function that should be called when the save execution is finished
@openEmitted when open method is called
@closeEmitted when close method is called

Multicolumns Form

If only field property is setted, the component will understand that there are only form component. But, there are cases that use multiple forms in one. For this, use fieldsGroup,that is a array of objects with the following properties:

{
  title: 'Box title',
  color: 'Background color for caption box',
  fields: [] // an array of objects for formly
}

Examples

See the example of the two uses

See the demo

Component Methods

MethodSignatureDescription
openopen () {}open modal and emit event
closeclose () {}close modal and emit event
setModelsetMethod (model, isUpdateBkp = false) {}update internalModel and optionally, the model backup
4.0.0

6 years ago

3.2.0

6 years ago

3.1.0

6 years ago

3.0.0

6 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago