จัด โค้ด รายการสืบสวนข้อเท็จจริง

This commit is contained in:
setthawutttty 2023-11-10 13:35:26 +07:00
parent aeaa8c8df2
commit 0e03d4279d
5 changed files with 79 additions and 31 deletions

View file

@ -7,11 +7,9 @@ import { useRouter, useRoute } from "vue-router";
const router = useRouter();
const route = useRoute();
const id = ref<string>(route.params.id as string);
onMounted(() => {
fetchData();
});
// get
/** ข้อมูล v-model ของฟอร์ม */
const data = reactive<FormData>({
complaint: "",
complaintdetail: "",
@ -29,6 +27,7 @@ const data = reactive<FormData>({
causeText: "",
});
/** จำลองข้อมูลจาก api */
const fetchData = async () => {
// api
data.complaint = "เรื่องที่ 1";
@ -47,12 +46,20 @@ const fetchData = async () => {
data.causeText = "";
};
//
const onSubmit = async (id: string) => {
/**
* นทกขอมลทเเกไข
* @param id ระบ คคล
*/
async function onSubmit(id:string){
// put
console.log("edit");
console.log("edit",id);
router.push(`/discipline/investigatefacts`);
};
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
onMounted(() => {
fetchData();
});
</script>
<template>