|
|
@@ -1,7 +1,8 @@
|
|
|
import { type ObjectEmitsOptions, baseEmit } from '@vue/runtime-dom'
|
|
|
import type { VaporComponent, VaporComponentInstance } from './component'
|
|
|
import { EMPTY_OBJ, hasOwn, isArray } from '@vue/shared'
|
|
|
-import { resolveSource } from './componentProps'
|
|
|
+import { type RawProps, resolveSource } from './componentProps'
|
|
|
+import { interopKey } from './vdomInterop'
|
|
|
|
|
|
/**
|
|
|
* The logic from core isn't too reusable so it's better to duplicate here
|
|
|
@@ -40,13 +41,17 @@ export function emit(
|
|
|
)
|
|
|
}
|
|
|
|
|
|
-function propGetter(rawProps: Record<string, any>, key: string) {
|
|
|
+function propGetter(rawProps: RawProps, key: string) {
|
|
|
const dynamicSources = rawProps.$
|
|
|
if (dynamicSources) {
|
|
|
let i = dynamicSources.length
|
|
|
while (i--) {
|
|
|
const source = resolveSource(dynamicSources[i])
|
|
|
- if (hasOwn(source, key)) return resolveSource(source[key])
|
|
|
+ if (hasOwn(source, key))
|
|
|
+ // for props passed from VDOM component, no need to resolve
|
|
|
+ return dynamicSources[interopKey]
|
|
|
+ ? source[key]
|
|
|
+ : resolveSource(source[key])
|
|
|
}
|
|
|
}
|
|
|
return rawProps[key] && resolveSource(rawProps[key])
|