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