I'm trying to make use of the main component inside another with pre-defined properties.
Here's what I'm trying to achieve, but I'm just getting an empty div as a result.
<template>
<call-dialog-link
:id="id"
:url=url"
message="Are you sure you wish to remove this record?"
label="Remove"
css-classes="alert"
></call-dialog-link>
</template>
<script>
import CallDialogLink from './CallDialogLink.vue';
export default {
props: {
id: {
type: String,
required: true
},
url: {
type: String,
required: true
}
},
components: {
'call-dialog-link': CallDialogLink
}
};
</script>
Here's the CallDialogLink
component
<template>
<span class="clickAble" :class="cssClasses" v-text="label" @click="clicked()"></span>
</template>
<script>
export default {
props: {
id: {
type: String,
required: true
},
url: {
type: String,
required: true
},
message: {
type: String,
required: true
},
label: {
type: String,
required: true
},
cssClasses: {
type: String,
required: false
}
},
mounted() {
window.EventHandler.listen('remove-dialog-' + this.id + '-called', (data) => {
window.location.reload(true);
});
},
methods: {
clicked() {
window.EventHandler.fire('top-confirm', {
id: 'remove-dialog-' + this.id,
message: this.message,
url: this.url
});
}
}
};
</script>
Any idea what I'm doing wrong?
message
,label
,css-classes
dont have property binding on them? – BusinessCallDialogLink
from within this component. As they are just strings, I don't have to use dynamic binding. – Mishacreated
hook if the<call-dialog-link>
component if you are receiving those props? – Business<div>
? also, could you please post the code for the<call-dialog-link>
– BusinessCallDialogLink
. When wrapped withdiv
- it only returned static properties asstring
. – Mishawindow.location.reload
won't this clear the props? – Businessdiv
wrapper, what are the values received? – Business