Skip to content

Use VueUse composable useVModel to update all props  #147

@abbjetmus

Description

@abbjetmus

Hi! Thank you for the work put in Blitzar.

I'm using Blitzar to create a dynamic form creator where user selects form-components and then modify properties on the form components. Change schema values.
I would like to use VueUse composable to achieve this change props and then updating through emits the schema and not just form data. Is this possible could you give some hints best way to change schema from component? here is an example only works for formData modeValue but not schema props:

<template>
  <q-input
        ref="input"
        type="text"
        outlined
        :required="required"
        :readonly="readonly"
        :label="text"
        v-model="modelValue"
    />
</template>
<script setup>

import { ref } from 'vue';
import { useVModel } from '@vueuse/core';

const emits = defineEmits([
  'update:modelValue',
  'update:required',
  'update:text',
]);
const props = defineProps([
  'modelValue',
  'name',
  'placeholder',
  'text',
  'required',
  'readonly',
]);

const modelValue = useVModel(props, 'modelValue', emits);
const required = useVModel(props, 'required', emits);
const text = useVModel(props, 'text', emits);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions