Skip to content

DynamicInput

Dynamic input

Basic Usage

vue

<script>
  import {DynamicInput} from "dynamicformdjx-vue2";

  export default {
    name: 'App',
    components: {DynamicInput},
    data() {
      return {
        dyRef: null,
        obj: {
          a: 'Hello world',
          b: 1314,
          c: [5, 2, 0]
        },
      }
    },
    methods: {
      setData() {
        this.$refs.dyRef.onSet({test: "helloWorld"})
      }
    }
  }
</script>

<template>
  <div>
    <DynamicInput v-model="obj" ref="dyRef" is-controller/>
    <pre>{{JSON.stringify(obj,null,2)}}</pre>
    <button @click="setData">setData helloWorld</button>
  </div>
</template>

Preview Demo

API

(Props and exposed methods are the same as the Vue 3 version)

Props

Go to v3 Props

Emits

Go to Emits

Expose

Go to Expose