Globally import form inputs to fix resolve

This commit is contained in:
Julien Nahum 2023-12-24 10:40:09 +01:00
parent d93b696b05
commit 8db2b09767
6 changed files with 2 additions and 63 deletions

View File

@ -1,55 +0,0 @@
import { defineAsyncComponent } from 'vue'
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'
import ScaleInput from './ScaleInput.vue'
export function registerComponents (app) {
[
HasError,
AlertError,
AlertSuccess,
VCheckbox,
VSelect,
CheckboxInput,
ColorInput,
TextInput,
SelectInput,
TextAreaInput,
FileInput,
ImageInput,
RatingInput,
FlatSelectInput,
ToggleSwitchInput,
ScaleInput
].forEach(Component => {
Component.name ? app.component(Component.name, Component) : app.component(Component.name, Component)
})
// 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')
))
}

View File

@ -124,10 +124,6 @@ export default {
} }
}, },
data () {
return {}
},
computed: { computed: {
fieldComponents () { fieldComponents () {
return { return {

View File

@ -5,7 +5,7 @@
<h3 class="font-semibold block text-lg"> <h3 class="font-semibold block text-lg">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline text-gray-500 mr-2 -mt-1" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline text-gray-500 mr-2 -mt-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" /> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
</svg> Show advanced options </svg> Show advanced sharing options
</h3> </h3>
</div> </div>
</template> </template>

View File

@ -46,6 +46,7 @@ export default defineNuxtConfig({
{ {
path: '~/components/forms', path: '~/components/forms',
pathPrefix: false, pathPrefix: false,
global: true,
}, },
{ {
path: '~/components/global', path: '~/components/global',

View File

@ -48,7 +48,6 @@ export default {
watch(form, (form) => { watch(form, (form) => {
if (form) { if (form) {
updatedForm.value = useForm(form) updatedForm.value = useForm(form)
console.log('updatedForm.value',updatedForm.value)
} }
}) })

View File

@ -13,8 +13,6 @@ export const useWorkingFormStore = defineStore('working_form', {
}), }),
actions: { actions: {
set (form) { set (form) {
console.log('setting working form', form)
console.trace();
this.content = form this.content = form
}, },
setProperties (properties) { setProperties (properties) {