Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

[Question] #306

Open
Alexandra2888 opened this issue May 26, 2022 · 0 comments
Open

[Question] #306

Alexandra2888 opened this issue May 26, 2022 · 0 comments

Comments

@Alexandra2888
Copy link

Can inputs be prepopulated with data from api? I tried like this but it's not working:


<script setup> import { reactive, computed, onMounted } from "vue"; import { TextField, EmailField } from "@asigloo/vue-dynamic-forms"; const user = reactive({ name:'', email: "", fax: "", uuid: "", }); const form = computed(() => ({ id: "user", fields: { name: TextField({ label: " Name", value: user.name }), email: EmailField({ label: "Email", value: user.email }), userFax: TextField({ label: " Fax", value: user.fax }), }, })); onMounted(async () => { try { user.value = await AxiosService.get( "/user/get", { name: user.name.value, email: user.email.value, fax: user.fax.value, uuid: user.uuid.value, }, { headers: { //headers }, } ).then(function (response) { console.log(response); }); } catch (e) { console.error(e); } }); </script>

Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant