Skip to content
Discussion options

You must be logged in to vote

App.vue

<template>
  <div>
    <XForm v-model:value="object" :fields="schema" />
    <pre>{{ object }}</pre>
  </div>
</template>

<script>
import XForm from './components/XForm.vue';
import { ref } from 'vue';

export default {
  components: {
    XForm,
  },
  setup() {
    const object = ref({
      name: '',
      dateOfBirth: '',
      eyeColor: '',
      bio: '',
    });
    const schema = ref([
      {
        field: 'name',
        label: 'Name',
        component: 'input',
        type: 'text',
      },
      {
        field: 'dateOfBirth',
        label: 'Date of Birth',
        component: 'input',
        type: 'date',
      },
      {
        field: 'eyeColor',
        label: 'E…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@chenxch
Comment options

Answer selected by Nikhil1017
Comment options

You must be logged in to vote
1 reply
@chenxch
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants