1.0.5 • Published 3 years ago

vuemik v1.0.5

Weekly downloads
5
License
MIT
Repository
-
Last release
3 years ago

Vuemik

Basic form builder for Vue.js.

Getting started

Installation

Install vuemik using npm or yarn

$ npm install vuemik

# or use yarn
$ yarn add vuemik

Example

Vue SFCs example

<template>
  <Vuemik
    :initialValues="{
      select: 1,
      textarea: 'Write stuff here...',
      checkbox: false,
      number: 42,
      text: 'Username',
      password: 's3cr3t',
    }"
    :onSubmit="onSubmit"
    v-slot="{ handleSubmit }"
  >
    <Field name="select" component="select">
      <option value="1">Choice 1</option>
      <option value="2">Choice 2</option>
    </Field>
    <Field name="textarea" component="textarea" />
    <Field name="checkbox" component="input" type="checkbox" />
    <Field name="text" component="input" type="text" />
    <Field name="number" component="input" type="number" />
    <Field name="password" component="input" type="password" />
    <Field name="submit" component="input" type="submit" @click="handleSubmit" />
  </Vuemik>
</template>

<script lang="ts">
  import { defineComponent } from 'vue';
  import { Vuemik, Field } from 'vuemik';

  export default defineComponent({
    name: 'App',
    components: {
      Vuemik,
      Field,
    },
    methods: {
      onSubmit: (e: Event) => {
        window.console.log(e);
      },
    },
  });
</script>

Available Props

PropDefaultDescription
onSubmitrequiredFunction to execute when the form is submitted
initialValuesrequiredForm fields initial values
1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago