Skip to content

Commit

Permalink
feat: ignoreReactivePattern支持shallowReactive特性
Browse files Browse the repository at this point in the history
  • Loading branch information
mackwang committed Jan 13, 2025
1 parent aee3491 commit 5432414
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/core/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export default class MpxProxy {

initApi () {
// 挂载扩展属性到实例上
proxy(this.target, Mpx.prototype, undefined, true, this.createProxyConflictHandler('mpx.prototype'), this.ignoreReactivePattern)
proxy(this.target, Mpx.prototype, undefined, true, this.createProxyConflictHandler('mpx.prototype'))
// 挂载混合模式下createPage中的自定义属性,模拟原生Page构造器的表现
if (this.options.__type__ === 'page' && !this.options.__pageCtor__) {
proxy(this.target, this.options, this.options.mpxCustomKeysForBlend, false, this.createProxyConflictHandler('page options'))
Expand Down
5 changes: 1 addition & 4 deletions packages/utils/src/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function diffAndCloneA (a, b) {
}
}

function proxy (target, source, keys, readonly, onConflict, markRawKeys) {
function proxy (target, source, keys, readonly, onConflict) {
if (!global.__mpx) {
console.warn('[Mpx utils warn]: Can not find "global.__mpx", "proxy" may encounter some potential problems!')
}
Expand All @@ -137,9 +137,6 @@ function proxy (target, source, keys, readonly, onConflict, markRawKeys) {
if (global.__mpx) {
const isRef = global.__mpx.isRef
// 对reactive对象代理时不需要处理ref解包
if (markRawKeys.test(key)) {
global.__mpx.markRaw(val)
}
if (!global.__mpx.isReactive(source)) {
const oldVal = source[key]
if (isRef(oldVal) && !isRef(val)) {
Expand Down

0 comments on commit 5432414

Please sign in to comment.