Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use VueUse composable useVModel to update all props #147

Open
abbjetmus opened this issue Nov 14, 2022 · 0 comments
Open

Use VueUse composable useVModel to update all props #147

abbjetmus opened this issue Nov 14, 2022 · 0 comments

Comments

@abbjetmus
Copy link

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant