提交 50903bb2 编写于 作者: D DCloud_LXH

feat(app): 解决 UniComponent 循环依赖

上级 0b1ac38e
......@@ -19,7 +19,8 @@ import {
} from '@dcloudio/uni-shared'
import { UniNode } from '../elements/UniNode'
import { createInvoker, createWxsEventInvoker } from '../modules/events'
import { type UniCustomElement, createWrapper } from '.'
import type { UniCustomElement } from '.'
import { createWrapper } from '../createWrapper'
import { $, removeElement } from '../store'
import {
JOB_PRIORITY_REBUILD,
......
import type { ComponentDescriptorVm } from '@dcloudio/uni-core'
import {
type ComponentInternalInstance,
type ComponentPublicInstance,
type defineComponent,
h,
} from 'vue'
import type { ComponentInternalInstance, ComponentPublicInstance } from 'vue'
import { UniComment } from '../elements/UniComment'
import { UniTextElement } from '../elements/UniTextElement'
import { UniTextNode } from '../elements/UniTextNode'
......@@ -111,12 +106,3 @@ export const BuiltInComponents = {
VIDEO: UniVideo,
'WEB-VIEW': UniWebView,
} as const
export type WrapperComponent = ReturnType<typeof createWrapper>
export function createWrapper(
component: ReturnType<typeof defineComponent>,
props: Record<string, any>
) {
return () => h(component, props)
}
import { type defineComponent, h } from 'vue'
export type WrapperComponent = ReturnType<typeof createWrapper>
export function createWrapper(
component: ReturnType<typeof defineComponent>,
props: Record<string, any>
) {
return () => h(component, props)
}
import {
ref,
Ref,
watch,
type ExtractPropTypes,
type Ref,
computed,
reactive,
onMounted,
onBeforeUnmount,
ExtractPropTypes,
onMounted,
reactive,
ref,
watch,
} from 'vue'
import { getRealPath } from '@dcloudio/uni-platform'
import { defineBuiltInComponent } from '../../helpers/component'
import { UniElement } from '../../helpers/UniElement'
import { CustomEventTrigger, useCustomEvent } from '../../helpers/useEvent'
import { type CustomEventTrigger, useCustomEvent } from '../../helpers/useEvent'
import ResizeSensor from '../resize-sensor/index'
const props = {
......@@ -100,7 +100,6 @@ export default /*#__PURE__*/ defineBuiltInComponent({
<uni-image ref={rootRef}>
<div style={state.modeStyle} />
{FIX_MODES[props.mode as keyof typeof FIX_MODES] ? (
// @ts-ignore
<ResizeSensor onResize={fixSize} />
) : (
<span></span>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册