I am trying to build very simple bootstrap alert component but Iam unable to figure out how to get innerHTML of my custom component.
Code:
Vue.component('my-alert', {
template: '#vue-alert',
props: ['type', 'title', 'message'],
created: function() {
this.message = this.innerHTML; // <---- NOT WORKING
}
});
var vm = new Vue({
el: 'body'
});
HTML:
<my-alert type="success" title="Important">My Message here.</my-alert>
I want to show the component whatever text is provided in it, in this case it should show My Message here.