()
| 162 | } |
| 163 | |
| 164 | scrollToHash() { |
| 165 | let { hash } = location |
| 166 | hash = hash && hash.substring(1) |
| 167 | if (!hash) return |
| 168 | |
| 169 | const el: HTMLElement | null = document.getElementById(hash) |
| 170 | if (!el) return |
| 171 | |
| 172 | // If we call scrollIntoView() in here without a setTimeout |
| 173 | // it won't scroll properly. |
| 174 | setTimeout(() => el.scrollIntoView(), 0) |
| 175 | } |
| 176 | |
| 177 | render() { |
| 178 | if (process.env.NODE_ENV === 'production') { |
no test coverage detected