From 4529fc133d039083e795eaa2aafedb8def6e334e Mon Sep 17 00:00:00 2001 From: hay-kot Date: Wed, 24 Feb 2021 17:32:19 -0900 Subject: [PATCH] abstract button props --- frontend/src/components/UI/UploadBtn.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/UI/UploadBtn.vue b/frontend/src/components/UI/UploadBtn.vue index 7f1caeeb5..2855d993c 100644 --- a/frontend/src/components/UI/UploadBtn.vue +++ b/frontend/src/components/UI/UploadBtn.vue @@ -2,8 +2,8 @@ - mdi-cloud-upload - {{ $t("general.upload") }} + {{ icon }} + {{ text ? text : defaultText }} @@ -13,12 +13,20 @@ import api from "@/api"; export default { props: { url: String, + text: { default: "Upload" }, + icon: { default: "mdi-cloud-upload" }, }, data: () => ({ file: null, isSelecting: false, }), + computed: { + defaultText() { + return this.$t("general.upload"); + }, + }, + methods: { async upload() { if (this.file != null) {