Update index.vue

parent 68388f04
......@@ -139,6 +139,7 @@
@SetFilePDF="SetFilePDF($event)"
@deleteAvatar="deleteAvatar"
@savePostInfo="addNewPost"
@shape="handlecheckShape"
/>
<AddUpdatePostDialog
......@@ -282,7 +283,8 @@ export default defineComponent({
sortable: false,
},
];
const shape = ref('0');
const shape = ref(0);
const pageIndex = ref(1);
const pageSize = ref(20);
const totalPage = ref(1);
......@@ -377,7 +379,12 @@ export default defineComponent({
avatarUploaded.value = await callApiUploadAvatar(
avatarFile.value as File
);
if(shape.value === 1){
filePDFUploaded.value = await callApiUploadAvatar(filePDF.value as File);
} else {
filePDFUploaded.value = ''
}
const data = {
image: avatarUploaded.value,
......@@ -463,6 +470,7 @@ export default defineComponent({
};
const updatePost = async (image: string, filePost: string) => {
const data = {
id: postId.value,
image,
......@@ -575,7 +583,8 @@ export default defineComponent({
}
};
const handlecheckShape = (value: any) => {
const handlecheckShape = (value: number) => {
shape.value = value
if (value === 1) {
const data = [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment