提交 c7504aef 编写于 作者: fxy060608's avatar fxy060608

fix(app): requireNativePlugin

上级 5e64c8a3
...@@ -73,9 +73,15 @@ function getSsrGlobalData() { ...@@ -73,9 +73,15 @@ function getSsrGlobalData() {
return uniShared.sanitise(globalData); return uniShared.sanitise(globalData);
} }
/**
* uni 对象是跨实例的,而此处列的 API 均是需要跟当前实例关联的,比如 requireNativePlugin 获取 dom 时,依赖当前 weex 实例
*/
function getCurrentSubNVue() { function getCurrentSubNVue() {
// @ts-ignore // @ts-ignore
return uni.getSubNVueById(plus.webview.currentWebview().id); return uni.getSubNVueById(plus.webview.currentWebview().id);
}
function requireNativePlugin(name) {
return weex.requireModule(name);
} }
function resolveEasycom(component, easycom) { function resolveEasycom(component, easycom) {
...@@ -151,6 +157,7 @@ exports.onTabItemTap = onTabItemTap; ...@@ -151,6 +157,7 @@ exports.onTabItemTap = onTabItemTap;
exports.onThemeChange = onThemeChange; exports.onThemeChange = onThemeChange;
exports.onUnhandledRejection = onUnhandledRejection; exports.onUnhandledRejection = onUnhandledRejection;
exports.onUnload = onUnload; exports.onUnload = onUnload;
exports.requireNativePlugin = requireNativePlugin;
exports.resolveEasycom = resolveEasycom; exports.resolveEasycom = resolveEasycom;
exports.shallowSsrRef = shallowSsrRef; exports.shallowSsrRef = shallowSsrRef;
exports.ssrRef = ssrRef; exports.ssrRef = ssrRef;
...@@ -28,6 +28,9 @@ declare interface CustomShareTimeline { ...@@ -28,6 +28,9 @@ declare interface CustomShareTimeline {
imageUrl?: string; imageUrl?: string;
} }
/**
* uni 对象是跨实例的,而此处列的 API 均是需要跟当前实例关联的,比如 requireNativePlugin 获取 dom 时,依赖当前 weex 实例
*/
export declare function getCurrentSubNVue(): any; export declare function getCurrentSubNVue(): any;
export declare function getSsrGlobalData(): any; export declare function getSsrGlobalData(): any;
...@@ -157,6 +160,8 @@ declare interface ReferrerInfo { ...@@ -157,6 +160,8 @@ declare interface ReferrerInfo {
extraData?: any; extraData?: any;
} }
export declare function requireNativePlugin(name: string): any;
declare interface ResizeOption { declare interface ResizeOption {
size: { size: {
windowWidth: number; windowWidth: number;
......
...@@ -41,9 +41,15 @@ function getSsrGlobalData() { ...@@ -41,9 +41,15 @@ function getSsrGlobalData() {
return sanitise(globalData); return sanitise(globalData);
} }
/**
* uni 对象是跨实例的,而此处列的 API 均是需要跟当前实例关联的,比如 requireNativePlugin 获取 dom 时,依赖当前 weex 实例
*/
function getCurrentSubNVue() { function getCurrentSubNVue() {
// @ts-ignore // @ts-ignore
return uni.getSubNVueById(plus.webview.currentWebview().id); return uni.getSubNVueById(plus.webview.currentWebview().id);
}
function requireNativePlugin(name) {
return weex.requireModule(name);
} }
function resolveEasycom(component, easycom) { function resolveEasycom(component, easycom) {
...@@ -93,4 +99,4 @@ const onNavigationBarSearchInputConfirmed = ...@@ -93,4 +99,4 @@ const onNavigationBarSearchInputConfirmed =
const onNavigationBarSearchInputFocusChanged = const onNavigationBarSearchInputFocusChanged =
/*#__PURE__*/ createHook(ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED); /*#__PURE__*/ createHook(ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED);
export { getCurrentSubNVue, getSsrGlobalData, onAddToFavorites, onBackPress, onError, onHide, onLaunch, onLoad, onNavigationBarButtonTap, onNavigationBarSearchInputChanged, onNavigationBarSearchInputClicked, onNavigationBarSearchInputConfirmed, onNavigationBarSearchInputFocusChanged, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, resolveEasycom, shallowSsrRef, ssrRef }; export { getCurrentSubNVue, getSsrGlobalData, onAddToFavorites, onBackPress, onError, onHide, onLaunch, onLoad, onNavigationBarButtonTap, onNavigationBarSearchInputChanged, onNavigationBarSearchInputClicked, onNavigationBarSearchInputConfirmed, onNavigationBarSearchInputFocusChanged, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, requireNativePlugin, resolveEasycom, shallowSsrRef, ssrRef };
/**
* uni 对象是跨实例的,而此处列的 API 均是需要跟当前实例关联的,比如 requireNativePlugin 获取 dom 时,依赖当前 weex 实例
*/
export function getCurrentSubNVue() { export function getCurrentSubNVue() {
// @ts-ignore // @ts-ignore
return uni.getSubNVueById(plus.webview.currentWebview().id) return uni.getSubNVueById(plus.webview.currentWebview().id)
} }
export function requireNativePlugin(name: string) {
return weex.requireModule(name)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册