diff --git a/packages/uni-mp-alipay/src/runtime/createComponent.ts b/packages/uni-mp-alipay/src/runtime/createComponent.ts index 7ab5a45ea7a641f51f7eeb2ac7e580ea6f924653..0fd8b62ae968af9266d0bee82732e70923ab04cd 100644 --- a/packages/uni-mp-alipay/src/runtime/createComponent.ts +++ b/packages/uni-mp-alipay/src/runtime/createComponent.ts @@ -10,7 +10,6 @@ import { initWxsCallMethods, } from '@dcloudio/uni-mp-core' import { - initBehavior, handleRef, handleLink, triggerEvent, @@ -117,7 +116,7 @@ export function initCreateComponent() { } if (__VUE_OPTIONS_API__) { mpComponentOptions.data = initData(vueOptions) - mpComponentOptions.mixins = initBehaviors(vueOptions, initBehavior) + mpComponentOptions.mixins = initBehaviors(vueOptions) } if (isComponent2) { diff --git a/packages/uni-mp-alipay/src/runtime/util.ts b/packages/uni-mp-alipay/src/runtime/util.ts index 5cf2d6cfd3f19e8da9835ba9c9f2b42ae2f15fa7..042cdd3068fb464848e880e92d8ffd260f5237a3 100644 --- a/packages/uni-mp-alipay/src/runtime/util.ts +++ b/packages/uni-mp-alipay/src/runtime/util.ts @@ -40,16 +40,6 @@ function customize(str: string) { return camelize(str.replace(customizeRE, '-')) } -export function initBehavior({ properties }: Record) { - const props: Record = {} - Object.keys(properties).forEach((key) => { - props[key] = properties[key].value - }) - return { - props, - } -} - export function initRelation( mpInstance: MPComponentInstance, detail: RelationOptions diff --git a/packages/uni-mp-core/src/runtime/component.ts b/packages/uni-mp-core/src/runtime/component.ts index 9872ff8992108f464c4b0f693d480414e18f23f4..6c79d49868a907d2bd5d51c75b16e069e44cb416 100644 --- a/packages/uni-mp-core/src/runtime/component.ts +++ b/packages/uni-mp-core/src/runtime/component.ts @@ -4,7 +4,7 @@ import { ComponentOptions, ComponentPublicInstance } from 'vue' // @ts-expect-error import { getExposeProxy } from 'vue' -import { initExtraOptions, initWxsCallMethods, initBehavior } from './util' +import { initExtraOptions, initWxsCallMethods } from './util' import { initProps } from './componentProps' import { applyOptions, initPropsObserver } from './componentOptions' @@ -109,7 +109,7 @@ export function parseComponent( } if (__VUE_OPTIONS_API__) { - applyOptions(mpComponentOptions, vueOptions, initBehavior) + applyOptions(mpComponentOptions, vueOptions) } initProps(mpComponentOptions) diff --git a/packages/uni-mp-core/src/runtime/componentOptions.ts b/packages/uni-mp-core/src/runtime/componentOptions.ts index e7bef776efc6d8e672c61653efb6d7857d7be52d..af7178a805bc7562506e2cfbc0b2d9210e80a1cb 100644 --- a/packages/uni-mp-core/src/runtime/componentOptions.ts +++ b/packages/uni-mp-core/src/runtime/componentOptions.ts @@ -83,13 +83,8 @@ function hasPropsChanged( return false } -export function initBehaviors( - vueOptions: ComponentOptions, - initBehavior: (behavior: any) => string | { props: any } -): string[] { +export function initBehaviors(vueOptions: ComponentOptions): string[] { const vueBehaviors = vueOptions.behaviors - const vueExtends = vueOptions.extends - const vueMixins = vueOptions.mixins let vueProps = vueOptions.props @@ -118,26 +113,13 @@ export function initBehaviors( } }) } - if (vueExtends && vueExtends.props) { - const behavior = {} - behaviors.push(initBehavior(behavior) as string) - } - if (isArray(vueMixins)) { - vueMixins.forEach((vueMixin) => { - if (vueMixin.props) { - const behavior = {} - behaviors.push(initBehavior(behavior) as string) - } - }) - } return behaviors } export function applyOptions( componentOptions: MPComponentOptions, - vueOptions: ComponentOptions, - initBehavior: (behavior: unknown) => string + vueOptions: ComponentOptions ) { componentOptions.data = initData(vueOptions) - componentOptions.behaviors = initBehaviors(vueOptions, initBehavior) + componentOptions.behaviors = initBehaviors(vueOptions) } diff --git a/packages/uni-mp-core/src/runtime/util.ts b/packages/uni-mp-core/src/runtime/util.ts index f4ac1a52d704cea0075af318e2a8378ea1bd20ff..ce3e4111bfc447c6588757a6844c14479142e244 100644 --- a/packages/uni-mp-core/src/runtime/util.ts +++ b/packages/uni-mp-core/src/runtime/util.ts @@ -8,10 +8,6 @@ import { import { MPComponentInstance, MPComponentOptions } from './component' -export function initBehavior(options: any) { - return Behavior(options) -} - export function initVueIds( vueIds: string | undefined, mpInstance: MPComponentInstance