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

chore: build

上级 1e9ca434
......@@ -81,6 +81,14 @@ const miniProgram = {
dynamicSlotNames: false,
},
directive: 's-',
lazyElement: {
editor: [
{
name: 'on',
arg: ['ready'],
},
],
},
component: {
dir: COMPONENTS_DIR,
},
......
......@@ -5396,20 +5396,12 @@ function vOn(value, key) {
}
else {
// add
mpInstance[name] = createInvoker(name, value, instance, mpInstance);
mpInstance[name] = createInvoker(value, instance);
}
return name;
}
const editorReady = 'eReady';
function createInvoker(name, initialValue, instance, mpInstance) {
function createInvoker(initialValue, instance) {
const invoker = (e) => {
const dataset = e.target && e.target.dataset;
// TODO 临时解决 editor ready 事件可能错乱的问题 https://github.com/dcloudio/uni-app/issues/3406
if (mpInstance && dataset && dataset[editorReady]) {
if (invoker.id !== dataset[editorReady]) {
return mpInstance[dataset[editorReady]](e);
}
}
patchMPEvent(e);
let args = [e];
if (e.detail && e.detail.__args__) {
......@@ -5418,7 +5410,12 @@ function createInvoker(name, initialValue, instance, mpInstance) {
const eventValue = invoker.value;
const invoke = () => callWithAsyncErrorHandling(patchStopImmediatePropagation(e, eventValue), instance, 5 /* NATIVE_EVENT_HANDLER */, args);
// 冒泡事件触发时,启用延迟策略,避免同一批次的事件执行时机不正确,对性能可能有略微影响 https://github.com/dcloudio/uni-app/issues/3228
const eventSync = dataset && dataset.eventsync;
const eventTarget = e.target;
const eventSync = eventTarget
? eventTarget.dataset
? eventTarget.dataset.eventsync === 'true'
: false
: false;
if (bubbles.includes(e.type) && !eventSync) {
setTimeout(invoke);
}
......@@ -5426,7 +5423,6 @@ function createInvoker(name, initialValue, instance, mpInstance) {
return invoke();
}
};
invoker.id = name;
invoker.value = initialValue;
return invoker;
}
......
......@@ -110,6 +110,7 @@ const NVUE_BUILT_IN_TAGS = [
'richtext',
'recycle-list',
'u-scalable',
'barcode',
];
const NVUE_U_BUILT_IN_TAGS = [
'u-text',
......
......@@ -106,6 +106,7 @@ const NVUE_BUILT_IN_TAGS = [
'richtext',
'recycle-list',
'u-scalable',
'barcode',
];
const NVUE_U_BUILT_IN_TAGS = [
'u-text',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册