i'm trying to over-ride a certain instance of my VueJS Component, however for some reason the component is still using the default value.
The value i'm trying to over-ride is the buttonClass
. The other props seem to work fine, so not too sure as to why this one isn't working.
Instance:
<delete-button buttonClass="is-info" csrf="{{ csrf_token() }}" action="redirects/delete-all"
text="Delete All" body="This will delete ALL redirects"></delete-button>
Component:
<template>
<form v-bind:action="action" method="post" @submit.prevent="confirm($event)">
<input type="hidden" name="_token" v-model="csrf">
<input type="hidden" v-model="id" name="id-value">
<button type="submit" :class="['button is-link', buttonClass]">
<i class="fas fa-trash-alt"></i>
<span v-html="text"></span>
</button>
</form>
</template>
<script>
export default {
props: {
'id': {},
'csrf': {},
'action': {},
'buttonClass': {
default: 'is-danger'
},
'text': {
default: 'Delete'
},
'title': {
default: 'Are you sure?'
},
'body': {
default: ''
}
}
// etc
}
</script>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…