Skip to content

Commit 5d94b2c

Browse files
Added separate 'removeButtonClass' prop
1 parent 925e2e6 commit 5d94b2c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

PictureInput.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
</div>
2626
</div>
2727
<button v-if="imageSelected" @click.prevent="selectImage" :class="buttonClass">{{ strings.change }}</button>
28-
<button v-if="imageSelected && removable" @click.prevent="removeImage" :class="buttonClass">{{ strings.remove }}</button>
28+
<button v-if="imageSelected && removable" @click.prevent="removeImage" :class="removeButtonClass">{{ strings.remove }}</button>
2929
</div>
3030
<div v-else>
3131
<button v-if="!imageSelected" @click.prevent="selectImage" :class="buttonClass">{{ strings.select }}</button>
3232
<div v-else>
3333
<div v-html="strings.selected"></div>
3434
<button @click.prevent="selectImage" :class="buttonClass">{{ strings.change }}</button>
35-
<button v-if="removable" @click.prevent="removeImage" :class="buttonClass">{{ strings.remove }}</button>
35+
<button v-if="removable" @click.prevent="removeImage" :class="removeButtonClass">{{ strings.remove }}</button>
3636
</div>
3737
</div>
3838
<input ref="fileInput" type="file" :name="name" :id="id" :accept="accept" @change="onFileChange">
@@ -75,6 +75,10 @@ export default {
7575
type: String,
7676
default: 'btn btn-primary button'
7777
},
78+
removeButtonClass: {
79+
type: String,
80+
default: 'btn btn-secondary button secondary'
81+
},
7882
crop: {
7983
type: Boolean,
8084
default: true

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ You can find an example project here: https://github.com/alessiomaffeis/vue-pict
7777
- **size**: (MB, optional) the maximum accepted file size in megabytes.
7878
- **removable**: (boolean, optional) set *:removable="true"* if you want to display a "Remove Photo" button. Default value: false.
7979
- **id, name**: (string, optional) the id and name attributes of the HTML input element.
80-
- **buttonClass**: (string, optional) the class which will be applied to the 'Change Photo' and 'Remove Photo' buttons.
80+
- **buttonClass**: (string, optional) the class which will be applied to the 'Change Photo' button.
81+
- **removeButtonClass**: (string, optional) the class which will be applied to the 'Remove Photo' button.
8182
- **customStrings**: (object, optional) use this to provide one or more custom strings (see the example above). Here are the available strings and their default values:
8283
```
8384
upload: '<p>Your device does not support file uploading.</p>', // HTML allowed

0 commit comments

Comments
 (0)