Message & Notice support SSR

This commit is contained in:
Aresn 2017-06-01 10:48:03 +08:00
parent 9b2034a5ab
commit e8e1677b47
3 changed files with 46 additions and 19 deletions

View file

@ -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) {