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

fix(v3): remove promisify logic (wx) https://ask.dcloud.net.cn/question/90807

上级 951bd143
......@@ -1446,8 +1446,12 @@ var serviceContext = (function () {
}
},
protocols: {
type: Array,
// 微信文档虽然写的是数组,但是可以正常传递字符串
type: [Array, String],
validator (value, params) {
if (typeof value === 'string') {
value = [value];
}
params.protocols = (value || []).filter(str => typeof str === 'string');
}
}
......@@ -8542,7 +8546,11 @@ var serviceContext = (function () {
}
plus.navigator.setStatusBarStyle(frontColor === '#000000' ? 'dark' : 'light');
const style = webview.getStyle();
if (style && style.titleNView) {
if (style && style.titleNView) {
if (style.titleNView.autoBackButton) {
styles.backButton = styles.backButton || {};
styles.backButton.color = frontColor;
}
webview.setStyle({
titleNView: styles
});
......@@ -8708,7 +8716,8 @@ var serviceContext = (function () {
}, callbackId) {
const options = {
buttons: itemList.map(item => ({
title: item
title: item,
color: itemColor
}))
};
if (title) {
......@@ -12006,6 +12015,16 @@ var serviceContext = (function () {
});
}
const wx = Object.create(null);
apis_1.forEach(name => {
if (api$2[name]) {
wx[name] = wrapper(name, api$2[name]);
} else {
wx[name] = wrapperUnimplemented(name);
}
});
function callHook (vm, hook, params) {
vm = vm.$vm || vm;
return vm.__call_hook && vm.__call_hook(hook, params)
......@@ -13488,6 +13507,9 @@ var serviceContext = (function () {
}
};
// 挂靠在uni上,暂不做全局导出
uni$1.__$wx__ = wx;
UniServiceJSBridge.publishHandler = publishHandler;
UniServiceJSBridge.invokeCallbackHandler = invokeCallbackHandler;
......
......@@ -26,7 +26,7 @@ function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
function noop () { }
function noop () {}
/**
* Create a cached version of a pure function.
......@@ -805,7 +805,9 @@ function Behavior (options) {
return options
}
const nextTick = Vue.nextTick;
const nextTick = Vue.nextTick;
var index = uni.__$wx__;
export default uni;
export default index;
export { Behavior, Component, Page, nextTick };
......@@ -49,4 +49,4 @@ export function Behavior (options) {
export const nextTick = Vue.nextTick
export default uni
export default uni.__$wx__
......@@ -10,6 +10,10 @@ import {
publishHandler
} from 'uni-platform/service/publish-handler'
import {
wx
} from './wx'
import {
definePage
} from '../page-factory'
......@@ -26,6 +30,9 @@ import {
import vuePlugin from './framework/plugins'
// 挂靠在uni上,暂不做全局导出
uni.__$wx__ = wx
UniServiceJSBridge.publishHandler = publishHandler
UniServiceJSBridge.invokeCallbackHandler = invokeCallbackHandler
......
import apis from '../../../../lib/apis'
import {
wrapper,
wrapperUnimplemented
} from 'uni-helpers/api'
import api from 'uni-service-api'
export const wx = Object.create(null)
apis.forEach(name => {
if (api[name]) {
wx[name] = wrapper(name, api[name])
} else {
wx[name] = wrapperUnimplemented(name)
}
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册