fix(deps): tocbot has no initialization detection (#957)

Resolves #957
This commit is contained in:
Cotes Chung 2023-03-31 05:05:33 +08:00
parent 8b4f99c87f
commit 8225174cb5
No known key found for this signature in database
GPG key ID: 0D9E54843167A808

View file

@ -1,4 +1,5 @@
export function toc() {
if (document.querySelector('#core-wrapper h2,#core-wrapper h3')) {
// see: https://github.com/tscanlin/tocbot#usage
tocbot.init({
tocSelector: '#toc',
@ -8,4 +9,5 @@ export function toc() {
orderedList: false,
scrollSmooth: false
});
}
}