提交 1a97104c 编写于 作者: inkwalk's avatar inkwalk

fix(weixin): protocol showActionSheet, title -> alertText

上级 459c0452
......@@ -4,5 +4,6 @@ export { getSystemInfo } from './getSystemInfo'
export { getSystemInfoSync } from './getSystemInfoSync'
export { redirectTo } from './redirectTo'
export { previewImage } from './previewImage'
export { showActionSheet } from './showActionSheet'
export { navigateTo, initEventChannel, getEventChannel } from './navigateTo'
export * from './types'
import { MPProtocol } from './types'
export const showActionSheet: MPProtocol = {
args(
fromArgs: UniApp.ShowActionSheetOptions,
toArgs: WechatMiniprogram.ShowActionSheetOption
) {
toArgs.alertText = fromArgs.title
},
}
......@@ -52,6 +52,7 @@ export {
getSystemInfoSync,
addSafeAreaInsets,
useDeviceId,
showActionSheet,
} from './api/protocols'
// types
export { MiniProgramAppOptions, MiniProgramAppInstance } from './runtime/app'
......
......@@ -17,10 +17,6 @@ function invokeCreateVueAppHook(app) {
createVueAppHooks.forEach((hook) => hook(app));
}
function getBaseSystemInfo() {
return wx.getSystemInfoSync()
}
const E = function () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
......@@ -72,6 +68,10 @@ E.prototype = {
};
var E$1 = E;
function getBaseSystemInfo() {
return wx.getSystemInfoSync()
}
function validateProtocolFail(name, msg) {
console.warn(`${name}: ${msg}`);
}
......@@ -958,6 +958,12 @@ const previewImage = {
},
};
const showActionSheet = {
args(fromArgs, toArgs) {
toArgs.alertText = fromArgs.title;
},
};
const mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
const getProvider = initGetProvider({
......@@ -998,7 +1004,8 @@ var protocols = /*#__PURE__*/Object.freeze({
redirectTo: redirectTo,
previewImage: previewImage,
getSystemInfo: getSystemInfo,
getSystemInfoSync: getSystemInfoSync
getSystemInfoSync: getSystemInfoSync,
showActionSheet: showActionSheet
});
var index = initUni(shims, protocols);
......
......@@ -22,12 +22,10 @@ const ON_TAB_ITEM_TAP = 'onTabItemTap';
const ON_REACH_BOTTOM = 'onReachBottom';
const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const customizeRE = /:/g;
function customizeEvent(str) {
return camelize(str.replace(customizeRE, '-'));
}
function hasLeadingSlash(str) {
return str.indexOf('/') === 0;
}
......@@ -71,7 +69,6 @@ function stringifyQuery(obj, encodeStr = encode) {
: null;
return res ? `?${res}` : '';
}
const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => {
return {
onPageScroll: 1,
......
......@@ -3,4 +3,5 @@ export {
previewImage,
getSystemInfo,
getSystemInfoSync,
showActionSheet,
} from '@dcloudio/uni-mp-core'
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册