diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index 6e33c0b1360867c04b9bf7a3d8567e4d891b3d98..39935e5b68b03b89ed53c394256b395bc48fde59 100644 --- a/packages/uni-app-plus/dist/index.js +++ b/packages/uni-app-plus/dist/index.js @@ -499,6 +499,15 @@ var eventApi = /*#__PURE__*/Object.freeze({ $emit: $emit }); +function requireNativePlugin (pluginName) { + /* eslint-disable no-undef */ + if (typeof weex !== 'undefined') { + return weex.requireModule(pluginName) + } + /* eslint-disable no-undef */ + return __requireNativePlugin__(pluginName) +} + function wrapper$1 (webview) { webview.$processed = true; @@ -521,7 +530,9 @@ function wrapper$1 (webview) { } const maskColor = webview.__uniapp_mask; let maskWebview = webview.__uniapp_mask_id === '0' ? { - setStyle ({ mask }) { + setStyle ({ + mask + }) { requireNativePlugin('uni-tabview').setMask({ color: mask }); @@ -564,18 +575,11 @@ function getSubNVueById (id) { return webview } -function requireNativePlugin (pluginName) { - /* eslint-disable no-undef */ - if (typeof weex !== 'undefined') { - return weex.requireModule(pluginName) - } - /* eslint-disable no-undef */ - return __requireNativePlugin__(pluginName) -} + var api = /*#__PURE__*/Object.freeze({ - requireNativePlugin: requireNativePlugin, - getSubNVueById: getSubNVueById + getSubNVueById: getSubNVueById, + requireNativePlugin: requireNativePlugin }); const MPPage = Page; diff --git a/src/platforms/app-plus/runtime/api/index.js b/src/platforms/app-plus/runtime/api/index.js index 0e956fdbcb0976d6969ba47878254949ea90d384..4d999267facb5a73205a47c76d41568156cef9ec 100644 --- a/src/platforms/app-plus/runtime/api/index.js +++ b/src/platforms/app-plus/runtime/api/index.js @@ -1,10 +1,2 @@ -export function requireNativePlugin (pluginName) { - /* eslint-disable no-undef */ - if (typeof weex !== 'undefined') { - return weex.requireModule(pluginName) - } - /* eslint-disable no-undef */ - return __requireNativePlugin__(pluginName) -} - -export * from './sub-nvue' +export * from './sub-nvue' +export * from './require-native-plugin' diff --git a/src/platforms/app-plus/runtime/api/require-native-plugin.js b/src/platforms/app-plus/runtime/api/require-native-plugin.js new file mode 100644 index 0000000000000000000000000000000000000000..7ebf9f8b8f0bff00e681855f3a0bd0f25f8ec846 --- /dev/null +++ b/src/platforms/app-plus/runtime/api/require-native-plugin.js @@ -0,0 +1,8 @@ +export function requireNativePlugin (pluginName) { + /* eslint-disable no-undef */ + if (typeof weex !== 'undefined') { + return weex.requireModule(pluginName) + } + /* eslint-disable no-undef */ + return __requireNativePlugin__(pluginName) +} diff --git a/src/platforms/app-plus/runtime/api/sub-nvue.js b/src/platforms/app-plus/runtime/api/sub-nvue.js index d3cfa15a38e0d461aebaf02249987c9defb74482..dd2d2a63eed9047fdba3f41063ff5f88ab8a0204 100644 --- a/src/platforms/app-plus/runtime/api/sub-nvue.js +++ b/src/platforms/app-plus/runtime/api/sub-nvue.js @@ -1,4 +1,6 @@ -import { requireNativePlugin } from './index' +import { + requireNativePlugin +} from './require-native-plugin' function wrapper (webview) { webview.$processed = true @@ -22,7 +24,9 @@ function wrapper (webview) { } const maskColor = webview.__uniapp_mask let maskWebview = webview.__uniapp_mask_id === '0' ? { - setStyle ({ mask }) { + setStyle ({ + mask + }) { requireNativePlugin('uni-tabview').setMask({ color: mask }) @@ -63,4 +67,4 @@ export function getSubNVueById (id) { wrapper(webview) } return webview -} +}