( data: any, _tag: string, value: any, _asProp: boolean, isSync?: boolean, )
| 25 | } |
| 26 | |
| 27 | export function legacyBindObjectProps( |
| 28 | data: any, |
| 29 | _tag: string, |
| 30 | value: any, |
| 31 | _asProp: boolean, |
| 32 | isSync?: boolean, |
| 33 | ): any { |
| 34 | if (value && isObject(value)) { |
| 35 | if (isArray(value)) { |
| 36 | value = toObject(value) |
| 37 | } |
| 38 | for (const key in value) { |
| 39 | if (isReservedProp(key)) { |
| 40 | data[key] = value[key] |
| 41 | } else if (key === 'class') { |
| 42 | data.class = normalizeClass([data.class, value.class]) |
| 43 | } else if (key === 'style') { |
| 44 | data.style = normalizeClass([data.style, value.style]) |
| 45 | } else { |
| 46 | const attrs = data.attrs || (data.attrs = {}) |
| 47 | const camelizedKey = camelize(key) |
| 48 | const hyphenatedKey = hyphenate(key) |
| 49 | if (!(camelizedKey in attrs) && !(hyphenatedKey in attrs)) { |
| 50 | attrs[key] = value[key] |
| 51 | |
| 52 | if (isSync) { |
| 53 | const on = data.on || (data.on = {}) |
| 54 | on[`update:${key}`] = function ($event: any) { |
| 55 | value[key] = $event |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | return data |
| 63 | } |
| 64 | |
| 65 | export function legacyBindObjectListeners(props: any, listeners: any): Data { |
| 66 | return mergeProps(props, toHandlers(listeners)) |
nothing calls this directly
no test coverage detected