vue3-core/packages/runtime-dom/src/modules/attrs.ts

8 lines
166 B
TypeScript
Raw Normal View History

export function patchAttr(el: Element, key: string, value: any) {
if (value == null) {
el.removeAttribute(key)
2018-09-19 23:35:38 +08:00
} else {
el.setAttribute(key, value)
2018-09-19 23:35:38 +08:00
}
}