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

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

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