提交 aaebd4f6 编写于 作者: Q qiang

chore: build

上级 8ec58060
......@@ -1079,6 +1079,28 @@ function initSubscribeHandlers() {
subscribeWebviewReady({}, '1');
}
function initOn(app) {
app.addEventListener(ON_SHOW, function (event) {
const page = getCurrentPage();
invokeHook(getApp(), ON_SHOW, {
path: __uniConfig.entryPagePath,
});
if (page) {
invokeHook(page, ON_SHOW);
}
});
app.addEventListener(ON_HIDE, function () {
const page = getCurrentPage();
invokeHook(getApp(), ON_HIDE);
if (page) {
invokeHook(page, ON_HIDE);
}
});
}
function initService(app) {
initOn(app);
}
// import { initKeyboardEvent } from '../dom/keyboard'
let appCtx;
const defaultApp = {
......@@ -1089,7 +1111,7 @@ function initAppVm(appVm) {
appVm.$mpType = 'app';
// TODO uni-app x useI18n
}
function getApp({ allowDefault = false } = {}) {
function getApp$1({ allowDefault = false } = {}) {
if (appCtx) {
// 真实的 App 已初始化
return appCtx;
......@@ -1124,7 +1146,7 @@ function registerApp(appVm, app) {
initAppVm(appCtx);
extend(appCtx, defaultApp); // 拷贝默认实现
defineGlobalData(appCtx, defaultApp.globalData);
// initService()
initService(app);
// initEntry()
// initTabBar()
initGlobalEvent(app);
......@@ -1363,7 +1385,7 @@ var uni$1 = {
var index = {
uni: uni$1,
getApp,
getApp: getApp$1,
getCurrentPages: getCurrentPages$1,
__definePage: definePage,
__registerApp: registerApp,
......
......@@ -9108,6 +9108,9 @@ function setExtraClassStyle(el, classStyle) {
function getExtraStyle(el) {
return getNodeExtraData(el, NODE_EXT_STYLE);
}
function setExtraStyle(el, style) {
setNodeExtraData(el, NODE_EXT_STYLE, style);
}
function isCommentNode(node) {
return node.nodeName == '#comment';
}
......@@ -9273,7 +9276,7 @@ function toStyle(el, classStyle, classStyleWeights) {
style.forEach((value, key) => {
var weight = classStyleWeights[key];
// TODO: 目前只计算了 class 中 important 的权重,会存在 style class 同时设置 important 时,class 优先级更高的问题
if (weight == null || weight < 1000) {
if (weight == null || weight < WEIGHT_IMPORTANT) {
res.set(key, value);
}
});
......@@ -9383,16 +9386,6 @@ function updateChildrenClassStyle(el) {
});
}
}
function toMap(value) {
if (value instanceof Map) {
return value;
}
var map = new Map();
for (var key in value) {
map.set(key, value[key]);
}
return map;
}
function patchAttr(el, key, value) {
var instance = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
if (instance) {
......@@ -9533,26 +9526,28 @@ function patchStyle(el, prev, next) {
if (isString(next)) {
next = parseStringStyle(next);
}
var batchedStyles = {};
var batchedStyles = new Map();
var isPrevObj = prev && !isString(prev);
if (isPrevObj) {
for (var key in prev) {
if (next[key] == null) {
batchedStyles[camelize(key)] = '';
batchedStyles.set(camelize(key), '');
}
}
for (var _key21 in next) {
var value = next[_key21];
if (value !== prev[_key21]) {
batchedStyles[camelize(_key21)] = value;
batchedStyles.set(camelize(_key21), value);
}
}
} else {
for (var _key22 in next) {
batchedStyles[camelize(_key22)] = next[_key22];
batchedStyles.set(camelize(_key22), next[_key22]);
}
setExtraStyle(el, batchedStyles);
}
el.updateStyle(toMap(batchedStyles));
// TODO validateStyles(el, batchedStyles)
el.updateStyle(batchedStyles);
}
var vModelTags = ['u-input', 'u-textarea'];
var patchProp = function (el, key, prevValue, nextValue) {
......
......@@ -7448,6 +7448,9 @@ function setExtraClassStyle(el, classStyle) {
function getExtraStyle(el) {
return getNodeExtraData(el, NODE_EXT_STYLE);
}
function setExtraStyle(el, style) {
setNodeExtraData(el, NODE_EXT_STYLE, style);
}
function isCommentNode(node) {
return node.nodeName == '#comment';
}
......@@ -7613,7 +7616,7 @@ function toStyle(el, classStyle, classStyleWeights) {
style.forEach((value, key) => {
var weight = classStyleWeights[key];
// TODO: 目前只计算了 class 中 important 的权重,会存在 style class 同时设置 important 时,class 优先级更高的问题
if (weight == null || weight < 1000) {
if (weight == null || weight < WEIGHT_IMPORTANT) {
res.set(key, value);
}
});
......@@ -7723,16 +7726,6 @@ function updateChildrenClassStyle(el) {
});
}
}
function toMap(value) {
if (value instanceof Map) {
return value;
}
var map = new Map();
for (var key in value) {
map.set(key, value[key]);
}
return map;
}
function patchAttr(el, key, value) {
var instance = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
if (instance) {
......@@ -7873,26 +7866,28 @@ function patchStyle(el, prev, next) {
if (isString(next)) {
next = parseStringStyle(next);
}
var batchedStyles = {};
var batchedStyles = new Map();
var isPrevObj = prev && !isString(prev);
if (isPrevObj) {
for (var key in prev) {
if (next[key] == null) {
batchedStyles[camelize(key)] = '';
batchedStyles.set(camelize(key), '');
}
}
for (var _key13 in next) {
var value = next[_key13];
if (value !== prev[_key13]) {
batchedStyles[camelize(_key13)] = value;
batchedStyles.set(camelize(_key13), value);
}
}
} else {
for (var _key14 in next) {
batchedStyles[camelize(_key14)] = next[_key14];
batchedStyles.set(camelize(_key14), next[_key14]);
}
setExtraStyle(el, batchedStyles);
}
el.updateStyle(toMap(batchedStyles));
// TODO validateStyles(el, batchedStyles)
el.updateStyle(batchedStyles);
}
var vModelTags = ['u-input', 'u-textarea'];
var patchProp = function (el, key, prevValue, nextValue) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册