提交 06ec6a07 编写于 作者: Y yurj26

chore(mp-toutiao): build

上级 9c20da3c
......@@ -687,8 +687,6 @@ class EventChannel {
const eventChannels = {};
const eventChannelStack = [];
let id = 0;
function initEventChannel (events, cache = true) {
......@@ -696,31 +694,30 @@ function initEventChannel (events, cache = true) {
const eventChannel = new EventChannel(id, events);
if (cache) {
eventChannels[id] = eventChannel;
eventChannelStack.push(eventChannel);
}
return eventChannel
}
function getEventChannel (id) {
if (id) {
const eventChannel = eventChannels[id];
delete eventChannels[id];
return eventChannel
}
return eventChannelStack.shift()
const eventChannel = eventChannels[id];
delete eventChannels[id];
return eventChannel
}
var navigateTo = {
args (fromArgs, toArgs) {
const id = initEventChannel(fromArgs.events).id;
if (fromArgs.url) {
fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + id;
function navigateTo () {
let eventChannel;
return {
args (fromArgs, toArgs) {
eventChannel = initEventChannel(fromArgs.events);
if (fromArgs.url) {
fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + eventChannel.id;
}
},
returnValue (fromRes, toRes) {
fromRes.eventChannel = eventChannel;
}
},
returnValue (fromRes, toRes) {
fromRes.eventChannel = getEventChannel();
}
};
}
function findExistsPageIndex (url) {
const pages = getCurrentPages();
......@@ -1045,7 +1042,7 @@ const canIUses = [
// 需要做转换的 API 列表
const protocols = {
navigateTo,
navigateTo: navigateTo(),
redirectTo,
previewImage,
getSystemInfo,
......@@ -2457,8 +2454,8 @@ function isPage () {
function initRefs$1 (vm) {
const mpInstance = vm.$scope;
/* eslint-disable no-undef */
const minorVersion = parseInt(tt.getSystemInfoSync().SDKVersion.split('.')[1]);
if (minorVersion > 16) {
const [majorVersion = '', minorVersion = ''] = tt.getSystemInfoSync().SDKVersion.split('.');
if (parseInt(majorVersion) > 1 || parseInt(minorVersion) > 16) {
initRefs(vm);
} else {
mpInstance.selectAllComponents('.vue-ref', (components) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册