From 78f11e4079bd4e61d97175d142c1697dd4f7c1f1 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Thu, 24 Oct 2019 19:25:29 +0800 Subject: [PATCH] fix(v3): injectStyles() --- .../packages/webpack-uni-app-loader/view/main.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/vue-cli-plugin-uni/packages/webpack-uni-app-loader/view/main.js b/packages/vue-cli-plugin-uni/packages/webpack-uni-app-loader/view/main.js index 2d5efbb65b..0d42f19479 100644 --- a/packages/vue-cli-plugin-uni/packages/webpack-uni-app-loader/view/main.js +++ b/packages/vue-cli-plugin-uni/packages/webpack-uni-app-loader/view/main.js @@ -91,16 +91,17 @@ function getStylesCode(loaderContext) { module.exports = function(source, map) { return ` -import 'uni-pages' +import 'uni-pages' function initView(){ - ${getStylesCode(this)} + ${getStylesCode(this)} + injectStyles() ${getDefineComponents(parseComponents(source, traverse)).join('\n')} UniViewJSBridge.publishHandler('webviewReady') } if(typeof plus !== 'undefined'){ initView() } else { - document.addEventListener('plusready',initView) + document.addEventListener('plusready',initView) } ` } -- GitLab