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

fix(h5): wxs

上级 9cabb543
......@@ -5090,7 +5090,7 @@ function baseCreateRenderer(options, createHydrationFns) {
target.__VUE__ = true;
setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__);
}
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, // fixed by xxxxx
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, // fixed by xxxxxx
createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = shared.NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;
// Note: functions inside this closure should use `const xxx = () => {}`
// style in order to prevent being inlined by minifiers.
......@@ -5380,7 +5380,8 @@ function baseCreateRenderer(options, createHydrationFns) {
// #1471 force patch value
if (next !== prev ||
key === 'value' ||
(hostForcePatchProp && hostForcePatchProp(el, key))) {
(hostForcePatchProp && hostForcePatchProp(el, key)) // fixed by xxxxxx
) {
hostPatchProp(el, key, prev, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren);
}
}
......@@ -5452,7 +5453,7 @@ function baseCreateRenderer(options, createHydrationFns) {
const prev = oldProps[key];
// defer patching value
if ((next !== prev && key !== 'value') ||
(hostForcePatchProp && hostForcePatchProp(el, key)) // fixed by xxxxx
(hostForcePatchProp && hostForcePatchProp(el, key)) // fixed by xxxxxx
) {
hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
}
......@@ -9177,9 +9178,7 @@ function patchClass(el, value, isSVG) {
}
const transitionClasses = el._vtc;
if (transitionClasses) {
value = (value
? [value, ...transitionClasses]
: [...transitionClasses]).join(' ');
value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(' ');
}
if (value == null) {
el.removeAttribute('class');
......@@ -9513,6 +9512,21 @@ function patchWxs(el, rawName, nextValue, instance = null) {
}
const nativeOnRE = /^on[a-z]/;
// fixed by xxxxxx
const forcePatchProp = (el, key) => {
if (key.indexOf('change:') === 0) {
return true;
}
if (key === 'class' && el.__wxsClassChanged) {
el.__wxsClassChanged = false;
return true;
}
if (key === 'style' && el.__wxsStyleChanged) {
el.__wxsStyleChanged = false;
return true;
}
return false;
};
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
// @ts-expect-error fixed by xxxxxx
if (__UNI_FEATURE_WXS__ && key.indexOf('change:') === 0) {
......@@ -10596,7 +10610,8 @@ function setDisplay(el, value) {
el.style.display = value ? el._vod : 'none';
}
const rendererOptions = shared.extend({ patchProp }, nodeOps);
// fixed by xxxxxx
const rendererOptions = shared.extend({ patchProp, forcePatchProp }, nodeOps);
// lazy create the renderer - this makes core renderer logic tree-shakable
// in case the user only imports reactivity utilities from Vue.
let renderer;
......
......@@ -6291,7 +6291,7 @@ function baseCreateRenderer(options, createHydrationFns) {
target.__VUE__ = true;
setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__);
}
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, // fixed by xxxxx
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, // fixed by xxxxxx
createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;
// Note: functions inside this closure should use `const xxx = () => {}`
// style in order to prevent being inlined by minifiers.
......@@ -6581,7 +6581,8 @@ function baseCreateRenderer(options, createHydrationFns) {
// #1471 force patch value
if (next !== prev ||
key === 'value' ||
(hostForcePatchProp && hostForcePatchProp(el, key))) {
(hostForcePatchProp && hostForcePatchProp(el, key)) // fixed by xxxxxx
) {
hostPatchProp(el, key, prev, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren);
}
}
......@@ -6653,7 +6654,7 @@ function baseCreateRenderer(options, createHydrationFns) {
const prev = oldProps[key];
// defer patching value
if ((next !== prev && key !== 'value') ||
(hostForcePatchProp && hostForcePatchProp(el, key)) // fixed by xxxxx
(hostForcePatchProp && hostForcePatchProp(el, key)) // fixed by xxxxxx
) {
hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
}
......@@ -11027,9 +11028,7 @@ function patchClass(el, value, isSVG) {
}
const transitionClasses = el._vtc;
if (transitionClasses) {
value = (value
? [value, ...transitionClasses]
: [...transitionClasses]).join(' ');
value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(' ');
}
if (value == null) {
el.removeAttribute('class');
......@@ -11400,6 +11399,21 @@ function patchWxs(el, rawName, nextValue, instance = null) {
}
const nativeOnRE = /^on[a-z]/;
// fixed by xxxxxx
const forcePatchProp = (el, key) => {
if (key.indexOf('change:') === 0) {
return true;
}
if (key === 'class' && el.__wxsClassChanged) {
el.__wxsClassChanged = false;
return true;
}
if (key === 'style' && el.__wxsStyleChanged) {
el.__wxsStyleChanged = false;
return true;
}
return false;
};
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
// @ts-expect-error fixed by xxxxxx
if (__UNI_FEATURE_WXS__ && key.indexOf('change:') === 0) {
......@@ -12559,7 +12573,8 @@ function setDisplay(el, value) {
el.style.display = value ? el._vod : 'none';
}
const rendererOptions = extend({ patchProp }, nodeOps);
// fixed by xxxxxx
const rendererOptions = extend({ patchProp, forcePatchProp }, nodeOps);
// lazy create the renderer - this makes core renderer logic tree-shakable
// in case the user only imports reactivity utilities from Vue.
let renderer;
......
......@@ -6356,7 +6356,7 @@ function baseCreateRenderer(options, createHydrationFns) {
target.__VUE__ = true;
setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__);
}
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, // fixed by xxxxx
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, // fixed by xxxxxx
createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;
// Note: functions inside this closure should use `const xxx = () => {}`
// style in order to prevent being inlined by minifiers.
......@@ -6657,7 +6657,8 @@ function baseCreateRenderer(options, createHydrationFns) {
// #1471 force patch value
if (next !== prev ||
key === 'value' ||
(hostForcePatchProp && hostForcePatchProp(el, key))) {
(hostForcePatchProp && hostForcePatchProp(el, key)) // fixed by xxxxxx
) {
hostPatchProp(el, key, prev, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren);
}
}
......@@ -6729,7 +6730,7 @@ function baseCreateRenderer(options, createHydrationFns) {
const prev = oldProps[key];
// defer patching value
if ((next !== prev && key !== 'value') ||
(hostForcePatchProp && hostForcePatchProp(el, key)) // fixed by xxxxx
(hostForcePatchProp && hostForcePatchProp(el, key)) // fixed by xxxxxx
) {
hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
}
......@@ -11108,9 +11109,7 @@ function patchClass(el, value, isSVG) {
}
const transitionClasses = el._vtc;
if (transitionClasses) {
value = (value
? [value, ...transitionClasses]
: [...transitionClasses]).join(' ');
value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(' ');
}
if (value == null) {
el.removeAttribute('class');
......@@ -11482,6 +11481,21 @@ function patchWxs(el, rawName, nextValue, instance = null) {
}
const nativeOnRE = /^on[a-z]/;
// fixed by xxxxxx
const forcePatchProp = (el, key) => {
if (key.indexOf('change:') === 0) {
return true;
}
if (key === 'class' && el.__wxsClassChanged) {
el.__wxsClassChanged = false;
return true;
}
if (key === 'style' && el.__wxsStyleChanged) {
el.__wxsStyleChanged = false;
return true;
}
return false;
};
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
// @ts-expect-error fixed by xxxxxx
if (__UNI_FEATURE_WXS__ && key.indexOf('change:') === 0) {
......@@ -12664,7 +12678,8 @@ function setDisplay(el, value) {
el.style.display = value ? el._vod : 'none';
}
const rendererOptions = extend({ patchProp }, nodeOps);
// fixed by xxxxxx
const rendererOptions = extend({ patchProp, forcePatchProp }, nodeOps);
// lazy create the renderer - this makes core renderer logic tree-shakable
// in case the user only imports reactivity utilities from Vue.
let renderer;
......
......@@ -5151,7 +5151,7 @@ function baseCreateRenderer(options, createHydrationFns) {
target.__VUE__ = true;
setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__);
}
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, // fixed by xxxxx
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, // fixed by xxxxxx
createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;
// Note: functions inside this closure should use `const xxx = () => {}`
// style in order to prevent being inlined by minifiers.
......@@ -5452,7 +5452,8 @@ function baseCreateRenderer(options, createHydrationFns) {
// #1471 force patch value
if (next !== prev ||
key === 'value' ||
(hostForcePatchProp && hostForcePatchProp(el, key))) {
(hostForcePatchProp && hostForcePatchProp(el, key)) // fixed by xxxxxx
) {
hostPatchProp(el, key, prev, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren);
}
}
......@@ -5524,7 +5525,7 @@ function baseCreateRenderer(options, createHydrationFns) {
const prev = oldProps[key];
// defer patching value
if ((next !== prev && key !== 'value') ||
(hostForcePatchProp && hostForcePatchProp(el, key)) // fixed by xxxxx
(hostForcePatchProp && hostForcePatchProp(el, key)) // fixed by xxxxxx
) {
hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);
}
......@@ -9255,9 +9256,7 @@ function patchClass(el, value, isSVG) {
}
const transitionClasses = el._vtc;
if (transitionClasses) {
value = (value
? [value, ...transitionClasses]
: [...transitionClasses]).join(' ');
value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(' ');
}
if (value == null) {
el.removeAttribute('class');
......@@ -9591,6 +9590,21 @@ function patchWxs(el, rawName, nextValue, instance = null) {
}
const nativeOnRE = /^on[a-z]/;
// fixed by xxxxxx
const forcePatchProp = (el, key) => {
if (key.indexOf('change:') === 0) {
return true;
}
if (key === 'class' && el.__wxsClassChanged) {
el.__wxsClassChanged = false;
return true;
}
if (key === 'style' && el.__wxsStyleChanged) {
el.__wxsStyleChanged = false;
return true;
}
return false;
};
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
// @ts-expect-error fixed by xxxxxx
if (__UNI_FEATURE_WXS__ && key.indexOf('change:') === 0) {
......@@ -10697,7 +10711,8 @@ function setDisplay(el, value) {
el.style.display = value ? el._vod : 'none';
}
const rendererOptions = extend({ patchProp }, nodeOps);
// fixed by xxxxxx
const rendererOptions = extend({ patchProp, forcePatchProp }, nodeOps);
// lazy create the renderer - this makes core renderer logic tree-shakable
// in case the user only imports reactivity utilities from Vue.
let renderer;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册