From 8f9bf29ee5a75f8774897294ca639f7efb55d43c Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Fri, 24 Feb 2017 16:05:19 +0800 Subject: [PATCH] fix(render): custom cover background image --- src/core/render/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/render/index.js b/src/core/render/index.js index b2907ab4c..4144adad9 100644 --- a/src/core/render/index.js +++ b/src/core/render/index.js @@ -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], '') }