opnform/resources/js/components/forms/index.js

54 lines
1.5 KiB
JavaScript
Raw Normal View History

2023-10-24 09:00:54 +00:00
import { defineAsyncComponent } from 'vue'
2022-09-20 19:59:52 +00:00
import HasError from './validation/HasError.vue'
import AlertError from './validation/AlertError.vue'
import AlertSuccess from './validation/AlertSuccess.vue'
import VCheckbox from './components/VCheckbox.vue'
import TextInput from './TextInput.vue'
import TextAreaInput from './TextAreaInput.vue'
import VSelect from './components/VSelect.vue'
import CheckboxInput from './CheckboxInput.vue'
import SelectInput from './SelectInput.vue'
import ColorInput from './ColorInput.vue'
import FileInput from './FileInput.vue'
import ImageInput from './ImageInput.vue'
import RatingInput from './RatingInput.vue'
import FlatSelectInput from './FlatSelectInput.vue'
import ToggleSwitchInput from './ToggleSwitchInput.vue'
2022-09-20 19:59:52 +00:00
2023-10-24 09:00:54 +00:00
export function registerComponents (app) {
[
HasError,
AlertError,
AlertSuccess,
VCheckbox,
VSelect,
CheckboxInput,
ColorInput,
TextInput,
SelectInput,
TextAreaInput,
FileInput,
ImageInput,
RatingInput,
FlatSelectInput,
ToggleSwitchInput
].forEach(Component => {
app.component(Component.name, Component)
})
2023-10-24 09:00:54 +00:00
// Register async components
app.component('SignatureInput', defineAsyncComponent(() =>
import('./SignatureInput.vue')
))
app.component('RichTextAreaInput', defineAsyncComponent(() =>
import('./RichTextAreaInput.vue')
))
app.component('PhoneInput', defineAsyncComponent(() =>
import('./PhoneInput.vue')
))
app.component('DateInput', defineAsyncComponent(() =>
import('./DateInput.vue')
))
}