Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6efe75b

Browse filesBrowse files
committed
refactor
1 parent 8c0e07b commit 6efe75b
Copy full SHA for 6efe75b

File tree

Expand file treeCollapse file tree

2 files changed

+8
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-8
lines changed

‎packages/runtime-vapor/src/component.ts

Copy file name to clipboardExpand all lines: packages/runtime-vapor/src/component.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface ComponentInternalInstance {
4747
scope: EffectScope
4848
component: FunctionalComponent | ObjectComponent
4949

50-
// TODO: VNodeProps & ExtraProps (key, ref, ...)
50+
// TODO: ExtraProps: key, ref, ...
5151
rawProps: { [key: string]: any }
5252

5353
// normalized options

‎packages/runtime-vapor/src/componentEmits.ts

Copy file name to clipboardExpand all lines: packages/runtime-vapor/src/componentEmits.ts
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@ export function emit(
4545
...rawArgs: any[]
4646
) {
4747
if (instance.isUnmounted) return
48-
const props = instance.rawProps
48+
const { rawProps } = instance
4949

5050
let args = rawArgs
5151
const isModelListener = event.startsWith('update:')
5252

5353
// for v-model update:xxx events, apply modifiers on args
5454
const modelArg = isModelListener && event.slice(7)
5555

56-
if (modelArg && modelArg in props) {
56+
if (modelArg && modelArg in rawProps) {
5757
const modifiersKey = `${
5858
modelArg === 'modelValue' ? 'model' : modelArg
5959
}Modifiers`
60-
const { number, trim } = props[modifiersKey] || EMPTY_OBJ
60+
const { number, trim } = rawProps[modifiersKey] || EMPTY_OBJ
6161
if (trim) {
6262
args = rawArgs.map(a => (isString(a) ? a.trim() : a))
6363
}
@@ -70,13 +70,13 @@ export function emit(
7070

7171
let handlerName
7272
let handler =
73-
props[(handlerName = toHandlerKey(event))] ||
73+
rawProps[(handlerName = toHandlerKey(event))] ||
7474
// also try camelCase event handler (#2249)
75-
props[(handlerName = toHandlerKey(camelize(event)))]
75+
rawProps[(handlerName = toHandlerKey(camelize(event)))]
7676
// for v-model update:xxx events, also trigger kebab-case equivalent
7777
// for props passed via kebab-case
7878
if (!handler && isModelListener) {
79-
handler = props[(handlerName = toHandlerKey(hyphenate(event)))]
79+
handler = rawProps[(handlerName = toHandlerKey(hyphenate(event)))]
8080
}
8181

8282
if (handler) {
@@ -88,7 +88,7 @@ export function emit(
8888
)
8989
}
9090

91-
const onceHandler = props[handlerName + `Once`]
91+
const onceHandler = rawProps[`${handlerName}Once`]
9292
if (onceHandler) {
9393
if (!instance.emitted) {
9494
instance.emitted = {}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.