0.0.26 • Published 8 months ago

vue-app-form v0.0.26

Weekly downloads
-
License
-
Repository
github
Last release
8 months ago

AppForm

Generate Form for quasar

Install npm or yarn

npm i vue-app-form
yarn add vue-app-form

Documentation

In your vue3 applications import component

<script setup lang="ts">
import { QInput } from 'quasar'
import { z } from 'zod'
import { AppForm, AppFormSchemaField } from 'vue-app-form'

const modelSchema = z.object({
  name: z.string().noempty(),
})

const schema: AppFormSchemaField[] = [
  {
    scope: 'name',
    component: QInput,
    defaultValue: '',
    componentProps: {
      label: 'Namn',
      // component props i.e from quasar
      square: true,
    },
  },
]
</script>

<template>
  <app-form :schema="schema" :model-schema="modelSchema" />
</template>

AppForm

PropDefaultRequired
schemaSee AppFormSchemaField interfaceYes
modelSchemaA ZodType ObjectYes
colGutterGutter of columns'sm'
modelValueBind formData
readonlyMake all fields readonlyfalse
disableMake all fields disabledfalse
loadingBind loading prop buttonsfalse
fieldWrapperWrapper around all fields'div'
Event
submitReturns validated formData if valid
resetReset formData to defaultValues
Slot
topTop slot for extra content
bottomBottom slot for extra content
[scope]Overwrite schema component

AppFormSchemaField interface

PropDefaultRequired
scopeObject path i.e 'obj.value'Yes
colsSpan number of cols (max 12)'cols-auto'
componentField componentYes
columnColumn position in row1
transformTransform value function before setting to modelValue
defaultValueDefault value of field if not specified in AppForm modelValue propYes
componentPropsProps to add to componentYes

AppSelect

Easy to use quasar q-select with filtering, add new value, checkbox list.

<script setup lang="ts">
import { ref } from 'vue'
import { AppSelect } from 'vue-app-form'

const model = ref([])
const options = [
   {
      value: 1,
      label: 'Test',
      // optional
      caption: 'Caption'
      disable: true
   },
   {
      value: 2,
      label: 'Test 2',
   }
]
</script>

<template>
  <app-select v-model="model" multiple :options="options" new-value />
</template>
0.0.26

8 months ago

0.0.25

8 months ago

0.0.24

8 months ago

0.0.23

8 months ago

0.0.22

8 months ago

0.0.21

8 months ago

0.0.20

8 months ago

0.0.19

8 months ago

0.0.18

8 months ago

0.0.17

8 months ago

0.0.16

8 months ago

0.0.15

8 months ago

0.0.14

8 months ago

0.0.13

8 months ago

0.0.12

8 months ago

0.0.11

8 months ago

0.0.10

8 months ago

0.0.9

8 months ago

0.0.8

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago

0.0.0

8 months ago