Refactoring code module 13_portfolio
This commit is contained in:
parent
33f23e4fc5
commit
54cfdd2f9b
3 changed files with 54 additions and 43 deletions
|
|
@ -2,14 +2,14 @@
|
|||
import { ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import axios from "axios";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import axios from "axios";
|
||||
import type { QForm } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const router = useRouter();
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { success, messageError, showLoader, hideLoader, dialogConfirm } = mixin;
|
||||
|
||||
|
|
@ -18,22 +18,12 @@ const { success, messageError, showLoader, hideLoader, dialogConfirm } = mixin;
|
|||
*/
|
||||
const route = useRoute();
|
||||
const files = ref<any>();
|
||||
const name = ref("");
|
||||
const detail = ref("");
|
||||
const name = ref<string>("");
|
||||
const detail = ref<string>("");
|
||||
const id = ref<string>("");
|
||||
const routeName = router.currentRoute.value.name;
|
||||
const fileList = ref<any[]>([]);
|
||||
|
||||
/**
|
||||
* เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้
|
||||
*/
|
||||
onMounted(() => {
|
||||
if (route.params.id !== undefined) {
|
||||
id.value = route.params.id.toString();
|
||||
fecthData(id.value);
|
||||
}
|
||||
});
|
||||
|
||||
const saveData = async () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -174,6 +164,16 @@ function fileOpen(fileName: string) {
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้
|
||||
*/
|
||||
onMounted(() => {
|
||||
if (route.params.id !== undefined) {
|
||||
id.value = route.params.id.toString();
|
||||
fecthData(id.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue