feat: finish ssr

This commit is contained in:
qingwei.li 2017-05-30 00:23:43 +08:00 • committed by cinwell.li
commit 3444884905
12 changed files with 163 additions and 40 deletions

View file

@ -172,20 +172,20 @@ export function initRender (vm) {
let html = ''
let navAppendToTarget = dom.body
if (!el) {
el = dom.create(id)
dom.appendTo(dom.body, el)
}
if (config.repo) {
html += tpl.corner(config.repo)
}
if (config.coverpage) {
html += tpl.cover()
}
if (el) {
if (config.repo) {
html += tpl.corner(config.repo)
}
if (config.coverpage) {
html += tpl.cover()
}
html += tpl.main(config)
// Render main app
vm._renderTo(el, html, true)
html += tpl.main(config)
// Render main app
vm._renderTo(el, html, true)
} else {
vm.rendered = true
}
if (config.mergeNavbar && isMobile) {
navAppendToTarget = dom.find('.sidebar')