mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
abstract button props
This commit is contained in:
parent
5f3a7ac69a
commit
4529fc133d
1 changed files with 10 additions and 2 deletions
|
@ -2,8 +2,8 @@
|
|||
<v-form ref="file">
|
||||
<input ref="uploader" class="d-none" type="file" @change="onFileChanged" />
|
||||
<v-btn :loading="isSelecting" @click="onButtonClick" color="accent" text>
|
||||
<v-icon left> mdi-cloud-upload </v-icon>
|
||||
{{ $t("general.upload") }}
|
||||
<v-icon left> {{ icon }}</v-icon>
|
||||
{{ text ? text : defaultText }}
|
||||
</v-btn>
|
||||
</v-form>
|
||||
</template>
|
||||
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue