Skip to content

Commit

Permalink
fix(render): custom cover background image
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Feb 24, 2017
1 parent d67d25f commit 8f9bf29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/render/index.js
Expand Up @@ -104,10 +104,12 @@ export function renderMixin (proto) {
let path = m[1]

dom.toggleClass(el, 'add', 'has-mask')
if (isAbsolutePath(m[1])) {
if (!isAbsolutePath(m[1])) {
path = getPath(getBasePath(this.config.basePath), m[1])
}
el.style.backgroundImage = `url(${path})`
el.style.backgroundSize = 'cover'
el.style.backgroundPosition = 'center center'
}
html = html.replace(m[0], '')
}
Expand Down

0 comments on commit 8f9bf29

Please sign in to comment.