(name: string)
| 88 | } |
| 89 | |
| 90 | syncPropAttr(name: string) { |
| 91 | let value = this[toCamelCase(name)]; |
| 92 | |
| 93 | if (!(value != null) || value === false) return this.removeAttribute(name); |
| 94 | |
| 95 | value = value === true ? name : value; |
| 96 | |
| 97 | if (typeof value === 'object') { |
| 98 | value = value.toJSON?.(); |
| 99 | |
| 100 | value = typeof value === 'object' ? JSON.stringify(value) : value; |
| 101 | } |
| 102 | super.setAttribute(name, value); |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | return ObserverComponent as unknown as T; |