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">
|
<v-form ref="file">
|
||||||
<input ref="uploader" class="d-none" type="file" @change="onFileChanged" />
|
<input ref="uploader" class="d-none" type="file" @change="onFileChanged" />
|
||||||
<v-btn :loading="isSelecting" @click="onButtonClick" color="accent" text>
|
<v-btn :loading="isSelecting" @click="onButtonClick" color="accent" text>
|
||||||
<v-icon left> mdi-cloud-upload </v-icon>
|
<v-icon left> {{ icon }}</v-icon>
|
||||||
{{ $t("general.upload") }}
|
{{ text ? text : defaultText }}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-form>
|
</v-form>
|
||||||
</template>
|
</template>
|
||||||
|
@ -13,12 +13,20 @@ import api from "@/api";
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
url: String,
|
url: String,
|
||||||
|
text: { default: "Upload" },
|
||||||
|
icon: { default: "mdi-cloud-upload" },
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
file: null,
|
file: null,
|
||||||
isSelecting: false,
|
isSelecting: false,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
defaultText() {
|
||||||
|
return this.$t("general.upload");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
async upload() {
|
async upload() {
|
||||||
if (this.file != null) {
|
if (this.file != null) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue