⚪
Vuetify-Form-Base
  • Introduction
  • News & Changes
  • Quickstart
    • Start with
    • Installation
    • Intro
    • Features
    • License
  • Form
    • Validation
  • Component
    • Async Loading
    • Attributes
    • From Schema to Component
    • Events
    • Grid
    • Slots
    • CSS
    • Custom Components
    • Tooltips
  • Schema
    • General
    • Autogeneration
    • Computed Schema
    • Display & Typography
    • Grouping Controls
    • Arrays
  • Input & Controls
    • Text-Field & Input
    • Checkbox, Switch & Sliders
    • Radio Buttons
    • Buttons
    • Select, Combo & Autocomplete
    • Lists & Treeviews
    • Date, Time & Color
    • Icons & Images
Powered by GitBook
On this page
  • Lazy loading your component
  • Vue-File
  • Example

Was this helpful?

  1. Component

Async Loading

Lazy loading your component

  1. lazy import of 'vFormBase' component

  2. asynchronous loading of the schema

  3. asynchronous loading of the model values

  4. asynchronous loading of the layout

Vue-File

<v-form-base 
    :model="myModel" 
    :schema="mySchema" 
    :col="myCol" 
/>
<script>
  export default {
    name: 'AsyncLoad',
    components: {
      // # STEP 1) Lazy Loading of 'vFormBase' component here
      'VFormBase': () => import('@/components/vFormBase')
    },
    data () {
      return {
        myModel: {},
        mySchema: {},
        myCol:{}
      }
    },
    async mounted () {
      // # STEP 2) Async Loading of Schema
     this.mySchema = await this.delay({
       name: { type: 'text' },
       checkbox: { type: 'checkbox' }      
      }),
      // # STEP 3) Async Loading of Value
      this.myModel = await this.delay({
        name: 'Base',
        checkbox: true      
      })
      // # STEP 4) Async Loading of Grid
      this.myCol= await this.delay({
        cols:12, 
      })
    },
    methods: {
      delay (obj) { 
        return new Promise((resolve, reject) => {
          setTimeout(() => resolve(obj), 1000)
        })
      }
    }
  }
</script>
PreviousValidationNextAttributes

Last updated 4 years ago

Was this helpful?

Example