diff --git a/packages/uni-mp-alipay/dist/uni.mp.esm.js b/packages/uni-mp-alipay/dist/uni.mp.esm.js index 51dba1cd2ffa0aaae6878c7dd8012255a22994ba..45f5062dd538c25f636de771f3eaf892242a0f16 100644 --- a/packages/uni-mp-alipay/dist/uni.mp.esm.js +++ b/packages/uni-mp-alipay/dist/uni.mp.esm.js @@ -149,8 +149,7 @@ function createEmitFn(oldEmit, ctx) { } } { - const vnode = this.$.vnode; - const props = vnode && vnode.props; + const props = scope.props; if (props && props[`on${capitalize(event)}`]) { return; } @@ -756,11 +755,8 @@ function triggerEvent(type, detail) { if (!handler) { return; } - const eventOpts = this.props['data-event-opts']; const target = { - dataset: { - eventOpts, - }, + dataset: {}, }; handler({ type: customize(type), diff --git a/packages/uni-mp-vue/dist/vue.runtime.esm.js b/packages/uni-mp-vue/dist/vue.runtime.esm.js index f273ff3ea6b8b5eb23674b5cb3a10b2f3251818f..b23fdfe5de2d994e8f8319b6783e17f9dea6ee24 100644 --- a/packages/uni-mp-vue/dist/vue.runtime.esm.js +++ b/packages/uni-mp-vue/dist/vue.runtime.esm.js @@ -4749,6 +4749,8 @@ function renderComponentRoot(instance) { instance.$ei = 0; // props pruneComponentPropsCache(uid); + instance.__counter = + instance.__counter === 0 ? 1 : 0; let result; const prev = setCurrentRenderingInstance(instance); try { @@ -5076,10 +5078,10 @@ function initApp(app) { const propsCaches = Object.create(null); function renderProps(props) { - const { uid } = getCurrentInstance(); + const { uid, __counter } = getCurrentInstance(); const propsId = (propsCaches[uid] || (propsCaches[uid] = [])).push(guardReactiveProps(props)) - 1; // 强制每次更新 - return uid + ',' + propsId + ',' + Math.random(); + return uid + ',' + propsId + ',' + __counter; } function pruneComponentPropsCache(uid) { delete propsCaches[uid]; diff --git a/packages/uni-mp-vue/lib/vue.runtime.esm.js b/packages/uni-mp-vue/lib/vue.runtime.esm.js index 167f95ffc71ae1aa9aded4942a9b7e6239f26d76..563b3307b83c281c86b51654bde59bebd48ad0b0 100644 --- a/packages/uni-mp-vue/lib/vue.runtime.esm.js +++ b/packages/uni-mp-vue/lib/vue.runtime.esm.js @@ -4749,6 +4749,8 @@ function renderComponentRoot(instance) { instance.$ei = 0; // props pruneComponentPropsCache(uid); + instance.__counter = + instance.__counter === 0 ? 1 : 0; let result; const prev = setCurrentRenderingInstance(instance); try { diff --git a/packages/uni-mp-vue/src/helpers/renderProps.ts b/packages/uni-mp-vue/src/helpers/renderProps.ts index 64b2bb9ebceebcefe1df442bd365dd85b1339ddb..d18b42cd4f3932e0e197ff2a11a0d65bed5c2d6b 100644 --- a/packages/uni-mp-vue/src/helpers/renderProps.ts +++ b/packages/uni-mp-vue/src/helpers/renderProps.ts @@ -1,15 +1,22 @@ -import { getCurrentInstance, guardReactiveProps } from 'vue' +import { + ComponentInternalInstance, + getCurrentInstance, + guardReactiveProps, +} from 'vue' const propsCaches: Record[]> = Object.create(null) export function renderProps(props: Data) { - const { uid } = getCurrentInstance()! + const { uid, __counter } = + getCurrentInstance()! as ComponentInternalInstance & { + __counter: number + } const propsId = (propsCaches[uid] || (propsCaches[uid] = [])).push( guardReactiveProps(props)! ) - 1 // 强制每次更新 - return uid + ',' + propsId + ',' + Math.random() + return uid + ',' + propsId + ',' + __counter } export function pruneComponentPropsCache(uid: number) {