Add basic "quick-delete" prop for model-crud
if set, and Delete button is clicked, will emit a "delete" event instead of navigating to a "delete" URL
This commit is contained in:
parent
cd71754f84
commit
ce70eb2b91
|
@ -66,13 +66,19 @@
|
|||
Edit This
|
||||
</b-button>
|
||||
|
||||
<b-button v-if="shouldAllowDelete()"
|
||||
<b-button v-if="shouldAllowDelete() && !quickDelete"
|
||||
type="is-danger"
|
||||
icon-left="trash"
|
||||
tag="router-link"
|
||||
:to="getDeleteURL()">
|
||||
Delete This
|
||||
</b-button>
|
||||
<b-button v-if="shouldAllowDelete() && quickDelete"
|
||||
type="is-danger"
|
||||
icon-left="trash"
|
||||
@click="$emit('delete')">
|
||||
Delete This
|
||||
</b-button>
|
||||
</div>
|
||||
|
||||
<slot name="quick-entry"></slot>
|
||||
|
@ -157,6 +163,10 @@ export default {
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
quickDelete: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hideButtons: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
|
Loading…
Reference in a new issue