diff --git a/packages/vue-cli-plugin-uni/lib/h5/index.js b/packages/vue-cli-plugin-uni/lib/h5/index.js index 5251e6855b1df04c45abd15e9b05e2cda6a4f6de..a00b7d3edc562798918617d2c663215792fbe6d3 100644 --- a/packages/vue-cli-plugin-uni/lib/h5/index.js +++ b/packages/vue-cli-plugin-uni/lib/h5/index.js @@ -113,7 +113,7 @@ global.onAppShow = function(){}; ` : '' return { - devtool: process.env.NODE_ENV === 'production' ? false : 'source-map', + devtool: process.env.NODE_ENV === 'production' ? false : 'cheap-module-eval-source-map', resolve: { extensions: ['.nvue'], alias: { diff --git a/packages/webpack-uni-pages-loader/lib/index-new.js b/packages/webpack-uni-pages-loader/lib/index-new.js index 57d258403b8cd3cd02846fda361066c7b36b0040..64c9716bd7304d537cde839c07f0cd83a0180c6b 100644 --- a/packages/webpack-uni-pages-loader/lib/index-new.js +++ b/packages/webpack-uni-pages-loader/lib/index-new.js @@ -17,7 +17,7 @@ const { } = require('@dcloudio/uni-cli-shared/lib/cache') const { - pagesJsonJsFileName, + // pagesJsonJsFileName, initAutoImportComponents } = require('@dcloudio/uni-cli-shared/lib/pages') @@ -41,11 +41,11 @@ module.exports = function (content) { isAppView = params.type === 'view' } - const pagesJsonJsPath = path.resolve(process.env.UNI_INPUT_DIR, pagesJsonJsFileName) + // const pagesJsonJsPath = path.resolve(process.env.UNI_INPUT_DIR, pagesJsonJsFileName) const manifestJsonPath = path.resolve(process.env.UNI_INPUT_DIR, 'manifest.json') const manifestJson = parseManifestJson(fs.readFileSync(manifestJsonPath, 'utf8')) - this.addDependency(pagesJsonJsPath) + // this.addDependency(pagesJsonJsPath) this.addDependency(manifestJsonPath) const pagesJson = parsePagesJson(content, { diff --git a/src/platforms/app-plus/view/components/cover-view/index.vue b/src/platforms/app-plus/view/components/cover-view/index.vue index 10e7d0a29b561f24afe4542800160638b1c2fa02..d3da5fadbfc08b22dd48e96bc0d798eee084df9b 100644 --- a/src/platforms/app-plus/view/components/cover-view/index.vue +++ b/src/platforms/app-plus/view/components/cover-view/index.vue @@ -1,11 +1,3 @@ - diff --git a/src/platforms/app-plus/view/mixins/cover.js b/src/platforms/app-plus/view/mixins/cover.js index c51aa9d98222ddc683a2e1401d21e81f66086d12..1f4751d173942df0295bf37a72370a59a3211b96 100644 --- a/src/platforms/app-plus/view/mixins/cover.js +++ b/src/platforms/app-plus/view/mixins/cover.js @@ -1,5 +1,5 @@ -const base = ['padding', 'borderRadius', 'borderColor', 'borderWidth', 'backgroundColor'] -const text = ['color', 'textAlign', 'lineHeight', 'fontSize', 'fontWeight', 'textOverflow', 'whiteSpace'] +const base = ['borderRadius', 'borderColor', 'borderWidth', 'backgroundColor'] +const text = ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'color', 'textAlign', 'lineHeight', 'fontSize', 'fontWeight', 'textOverflow', 'whiteSpace'] const image = [] const textAlign = { start: 'left', end: 'right' } let index = 0 @@ -35,30 +35,42 @@ export default { tags () { const position = this._getTagPosition() const style = this.style - return [ - { - tag: 'rect', - position, - rectStyles: { - color: style.backgroundColor, - radius: style.borderRadius, - borderColor: style.borderColor, - borderWidth: style.borderWidth - } - }, - this.coverType === 'image' ? { + const tags = [{ + tag: 'rect', + position, + rectStyles: { + color: style.backgroundColor, + radius: style.borderRadius, + borderColor: style.borderColor, + borderWidth: style.borderWidth + } + }] + if (this.coverType === 'image') { + tags.push({ tag: 'img', position, src: this.coverContent - } : { + }) + } else { + const lineSpacing = parseFloat(style.lineHeight) - parseFloat(style.fontSize) + let width = parseFloat(position.width) - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight) + width = width < 0 ? 0 : width + let height = parseFloat(position.height) - parseFloat(style.paddingTop) - lineSpacing / 2 - parseFloat(style.paddingBottom) + height = height < 0 ? 0 : height + tags.push({ tag: 'font', - position, + position: { + top: `${parseFloat(position.top) + parseFloat(style.paddingTop) + lineSpacing / 2}px`, + left: `${parseFloat(position.left) + parseFloat(style.paddingLeft)}px`, + width: `${width}px`, + height: `${height}px` + }, textStyles: { align: textAlign[style.textAlign] || style.textAlign, color: style.color, decoration: 'none', - lineSpacing: (parseFloat(style.lineHeight) - parseFloat(style.fontSize)) + 'px', - margin: style.padding, + lineSpacing: `${lineSpacing}px`, + margin: '0px', overflow: style.textOverflow, size: style.fontSize, verticalAlign: 'top', @@ -66,8 +78,9 @@ export default { whiteSpace: style.whiteSpace }, text: this.coverContent - } - ] + }) + } + return tags } }, mounted () {