Message & Notice support SSR
This commit is contained in:
parent
9b2034a5ab
commit
e8e1677b47
3 changed files with 46 additions and 19 deletions
|
@ -10,15 +10,18 @@ Notification.newInstance = properties => {
|
|||
props += ' :' + camelcaseToHyphen(prop) + '=' + prop;
|
||||
});
|
||||
|
||||
const div = document.createElement('div');
|
||||
div.innerHTML = `<notification${props}></notification>`;
|
||||
document.body.appendChild(div);
|
||||
|
||||
const notification = new Vue({
|
||||
el: div,
|
||||
const Instance = new Vue({
|
||||
data: _props,
|
||||
components: { Notification }
|
||||
}).$children[0];
|
||||
render (h) {
|
||||
return h(Notification, {
|
||||
props: _props
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
const component = Instance.$mount();
|
||||
document.body.appendChild(component.$el);
|
||||
const notification = Instance.$children[0];
|
||||
|
||||
return {
|
||||
notice (noticeProps) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue