Skip to content

Commit

Permalink
wip: fix patch prop
Browse files Browse the repository at this point in the history
  • Loading branch information
linzhe141 committed Sep 25, 2024
1 parent e075dfa commit c930666
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/runtime-dom/src/patchProp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { patchStyle } from './modules/style'
import { patchAttr } from './modules/attrs'
import { patchDOMProp } from './modules/props'
import { patchEvent } from './modules/events'
import { isFunction, isModelListener, isOn, isString } from '@vue/shared'
import {
camelize,
isFunction,
isModelListener,
isOn,
isString,
} from '@vue/shared'
import type { RendererOptions } from '@vue/runtime-core'
import type { VueElement } from './apiCustomElement'

Expand Down Expand Up @@ -41,6 +47,7 @@ export const patchProp: DOMRendererOptions['patchProp'] = (
? ((key = key.slice(1)), false)
: shouldSetAsProp(el, key, nextValue, isSVG)
) {
key = camelize(key)
patchDOMProp(el, key, nextValue, parentComponent)
// #6007 also set form state as attributes so they work with
// <input type="reset"> or libs / extensions that expect attributes
Expand Down Expand Up @@ -128,7 +135,7 @@ function shouldSetAsProp(
return false
}

if (key in el) {
if (camelize(key) in el) {
return true
}

Expand Down

0 comments on commit c930666

Please sign in to comment.