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
|
Edit This
|
||||||
</b-button>
|
</b-button>
|
||||||
|
|
||||||
<b-button v-if="shouldAllowDelete()"
|
<b-button v-if="shouldAllowDelete() && !quickDelete"
|
||||||
type="is-danger"
|
type="is-danger"
|
||||||
icon-left="trash"
|
icon-left="trash"
|
||||||
tag="router-link"
|
tag="router-link"
|
||||||
:to="getDeleteURL()">
|
:to="getDeleteURL()">
|
||||||
Delete This
|
Delete This
|
||||||
</b-button>
|
</b-button>
|
||||||
|
<b-button v-if="shouldAllowDelete() && quickDelete"
|
||||||
|
type="is-danger"
|
||||||
|
icon-left="trash"
|
||||||
|
@click="$emit('delete')">
|
||||||
|
Delete This
|
||||||
|
</b-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<slot name="quick-entry"></slot>
|
<slot name="quick-entry"></slot>
|
||||||
|
@ -157,6 +163,10 @@ export default {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
quickDelete: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
hideButtons: {
|
hideButtons: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
|
|
Loading…
Reference in a new issue