belum tampil data
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
const data = ref(null)
|
||||
const onSubmit = () => {
|
||||
import {useTypeUser} from "@/stores/api/typeUser"
|
||||
const {getTypeUser} = useTypeUser()
|
||||
|
||||
const onSubmit = async() => {
|
||||
// console.log("ini disimpan:",data.value?.data.typeUser);
|
||||
console.log("ini disimpan:",data.value.form$.data);
|
||||
|
||||
// console.log("ini disimpan:",data.value?.form$.data);
|
||||
await getTypeUser(data.value?.form$.data)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
22
stores/api/typeUser.ts
Normal file
22
stores/api/typeUser.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { defineStore } from "pinia";
|
||||
import axios from "axios";
|
||||
export const useTypeUser = defineStore("typeUser", () => {
|
||||
const data = ref<any>([]);
|
||||
const getTypeUser = async (body: Record<string, any>) => {
|
||||
const a = await $fetch("http://10.10.150.131:8080/api/menu/getlist", {
|
||||
mode: "no-cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Access-Control-Allow-Origin": "*"
|
||||
},
|
||||
method:"GET",
|
||||
})
|
||||
// .then((res) => {
|
||||
// data.value = res
|
||||
// console.log(data.value);
|
||||
// });
|
||||
// return data;
|
||||
console.log(a);
|
||||
};
|
||||
return { getTypeUser,data };
|
||||
});
|
||||
Reference in New Issue
Block a user