<script setup lang="ts">
import {ref} from "vue";

const data = ref(null)
const onSubmit = () => {
  // console.log("ini disimpan:",data.value?.data.typeUser);
  console.log("ini disimpan:",data.value.form$.data);

}
const listMenu = ref<any[]>([]);

$fetch(`/api/setting/getListMenu`)
    .then((response) => {
      console.log(response);
      listMenu.value = response;
    })
</script>

<template>
  <div class="d-flex  gap-1 mx-1 pa-7 pt-0 pb-0">
    <Vueform
        ref="data"
        validate-on="change|step"
        method="post"
        :endpoint="onSubmit"
        size="md"
        :display-errors="false"
    >
      <div v-for="item in listMenu" :key="item.id">
        <p>{{item.display}}</p>
      </div>
      <ButtonElement name="primaryButton" button-label="Button" :submits="true" size="lg"/>
    </Vueform>
  </div>
</template>
