mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-17 20:51:21 +08:00
feat: add es6.md
cheatsheet. b258494776
This commit is contained in:
@ -34,15 +34,15 @@
|
||||
document.documentElement.setAttribute('data-color-mode', mode);
|
||||
localStorage.setItem(LOCAL_NANE, mode);
|
||||
}
|
||||
</script><a href="https://github.com/jaywcjlove/reference" class="" target="__blank"><svg viewBox="0 0 16 16" fill="currentColor" height="1em" width="1em"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path></svg></a></div></div></nav><div class="wrap max-container"><header class="wrap-header h1wrap"><h1 id="homebrew-备忘清单"><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
|
||||
</script><a href="https://github.com/jaywcjlove/reference" class="" target="__blank"><svg viewBox="0 0 16 16" fill="currentColor" height="1em" width="1em"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path></svg></a></div></div></nav><div class="wrap h1body-exist max-container"><header class="wrap-header h1wrap"><h1 id="homebrew-备忘清单"><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
|
||||
<path d="M7.938 0a.214.214 0 0 0-.206.156c-.316 1.104.179 2.15.838 2.935.153.181.313.347.476.501a2.039 2.039 0 0 0-.665.02c-1.184.233-2.193.985-2.74 2.532a3.893 3.893 0 0 0-.2 1.466 1.565 1.565 0 0 0-1.156 1.504 1.59 1.59 0 0 0 1.227 1.541l.026 12.046c0 .195.1.377.264.482a.214.214 0 0 0 .008.005c.537.31 2.047.812 5.21.812 3.238 0 4.7-.678 5.181-1.04a.214.214 0 0 0 .008-.007.571.571 0 0 0 .206-.439c.002-.344.002-1.136.002-1.604a.143.143 0 0 1 .147-.144c.397.006.869.006 1.318.005a1.826 1.826 0 0 0 1.832-1.825v-5.804a1.826 1.826 0 0 0-1.825-1.826H16.56a.14.14 0 0 1-.143-.144V10.6h.007v-.001a1.573 1.573 0 0 0 1.356-1.556c0-.816-.627-1.489-1.424-1.563-.025-1.438-.437-2.126-.736-2.58a.214.214 0 0 0-.005-.007c-.364-.51-1.193-1.282-2.275-1.316-.503-.016-.842.124-1.125.254-.217.1-.42.177-.67.22.002-1.286.945-1.981.945-1.981a.214.214 0 0 0 .05-.298s-.087-.122-.21-.26c-.121-.136-.269-.294-.47-.378a.214.214 0 0 0-.079-.017.214.214 0 0 0-.145.055 4.308 4.308 0 0 0-.875 1.101 3.42 3.42 0 0 0-.133.273 3.497 3.497 0 0 0-.381-.846C9.794.978 9.063.436 8.017.016A.214.214 0 0 0 7.939 0zm.156.524c.85.378 1.43.83 1.79 1.403.274.438.426.962.484 1.584a3.07 3.07 0 0 0-.012.462 6.897 6.897 0 0 1-.168-.052 5.487 5.487 0 0 1-1.29-1.106c-.551-.657-.935-1.46-.804-2.291zM11.8 1.618c.07.054.141.101.212.18.034.039.032.04.058.073-.332.308-1.07 1.144-.952 2.453a.214.214 0 0 0 .222.195c.469-.017.782-.172 1.056-.299.273-.126.508-.228.931-.214.875.027 1.639.715 1.939 1.134.295.449.65 1 .663 2.36a1.66 1.66 0 0 0-.41.142 1.938 1.938 0 0 0-1.77-1.16 1.94 1.94 0 0 0-1.87 1.448 1.783 1.783 0 0 0-1.356-.64c-.484 0-.91.205-1.233.517a1.873 1.873 0 0 0-1.85-1.625c-.649 0-1.218.335-1.552.84a3.1 3.1 0 0 1 .157-.735c.51-1.437 1.355-2.045 2.42-2.254.367-.073.664-.011.99.095.325.106.671.262 1.094.342a.214.214 0 0 0 .252-.245c-.112-.67.073-1.266.336-1.744a3.71 3.71 0 0 1 .663-.863zM7.44 6.611a1.442 1.442 0 0 1 1.363 1.925.214.214 0 0 0 .168.283h.005a.214.214 0 0 0 .238-.146 1.373 1.373 0 0 1 2.613-.01.214.214 0 0 0 .417-.09 1.509 1.509 0 0 1 1.504-1.664c.678 0 1.249.445 1.442 1.056a.214.214 0 0 0 .259.143l.15-.04a.214.214 0 0 0 .051-.02 1.139 1.139 0 0 1 1.702.995 1.14 1.14 0 0 1-.985 1.131.214.214 0 0 0-.001 0 2.215 2.215 0 0 0-.485.126 10.65 10.65 0 0 1-1.176.365.214.214 0 0 0-.162.186 1.276 1.276 0 0 1-.146.478 2.07 2.07 0 0 0-.239 1.111l.001.151a.438.438 0 0 1-.16.36.665.665 0 0 1-.43.14.586.586 0 0 1-.588-.59.803.803 0 0 0-.38-.681.214.214 0 0 0-.002-.002c-.24-.145-.43-.37-.532-.636a.214.214 0 0 0-.207-.138 19.469 19.469 0 0 1-5.37-.6l-.003-.002a9.007 9.007 0 0 0-.838-.194h.003a1.16 1.16 0 0 1-.937-1.134c0-.619.488-1.118 1.101-1.14a.214.214 0 0 0 .204-.176 1.443 1.443 0 0 1 1.42-1.187zm8.549 4.106v.455c0 .314.259.573.572.573h1.329a1.397 1.397 0 0 1 1.397 1.397v5.804a1.396 1.396 0 0 1-1.402 1.396.214.214 0 0 0-.002 0c-.448.002-.918 0-1.31-.005a.573.573 0 0 0-.584.573c0 .468 0 1.262-.002 1.603a.214.214 0 0 0 0 .001c0 .042-.019.08-.05.107-.346.26-1.75.95-4.915.95-3.107 0-4.587-.52-4.99-.752a.143.143 0 0 1-.065-.118l-.025-11.955c.145.033.288.07.431.11a.214.214 0 0 0 .003 0c.115.031.246.064.383.097v10.37c0 .129.069.247.18.31.453.217 1.767.732 4.071.732 2.32 0 3.595-.626 4.022-.884a.357.357 0 0 0 .164-.3l.001-10.21c.267-.075.531-.158.792-.254zm-7.99.894a.493.493 0 0 1 .494.493v8.578a.493.493 0 0 1-.493.493.493.493 0 0 1-.494-.493v-8.578A.493.493 0 0 1 8 11.611zm8.652 1.14a.663.663 0 0 0-.662.662v5.208a.663.663 0 0 0 .662.662h1.14a.663.663 0 0 0 .662-.662v-5.209a.663.663 0 0 0-.662-.662zm0 .428h1.14a.233.233 0 0 1 .233.233v5.21a.233.233 0 0 1-.233.232h-1.14a.233.233 0 0 1-.233-.233v-5.209a.233.233 0 0 1 .233-.233z"></path>
|
||||
</svg>
|
||||
<a aria-hidden="true" tabindex="-1" href="#homebrew-备忘清单"><span class="icon icon-link"></span></a>Homebrew 备忘清单</h1><div class="wrap-body">
|
||||
<p>Homebrew 是 macOS(或Linux)缺少的包管理器,备忘清单包含 <a href="https://github.com/Homebrew/brew">brew</a> 命令的使用与安装</p>
|
||||
</div></header><div class="menu-tocs"><div class="menu-btn"><svg aria-hidden="true" fill="currentColor" height="1em" width="1em" viewBox="0 0 16 16" version="1.1" data-view-component="true">
|
||||
<path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zM3 8a1 1 0 11-2 0 1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"></path>
|
||||
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" href="#homebrew">Homebrew</a><a aria-hidden="true" class="leve3 tocs-link" href="#安装">安装</a><a aria-hidden="true" class="leve3 tocs-link" href="#命令">命令</a><a aria-hidden="true" class="leve3 tocs-link" href="#更多包命令">更多包命令</a><a aria-hidden="true" class="leve3 tocs-link" href="#brew-cask-命令">Brew Cask 命令</a><a aria-hidden="true" class="leve3 tocs-link" href="#全局命令">全局命令</a><a aria-hidden="true" class="leve3 tocs-link" href="#brew-清理">Brew 清理</a><a aria-hidden="true" class="leve3 tocs-link" href="#brew-源码仓库">brew 源码仓库</a><a aria-hidden="true" class="leve3 tocs-link" href="#搜索查看">搜索查看</a><a aria-hidden="true" class="leve3 tocs-link" href="#帮助命令">帮助命令</a><a aria-hidden="true" class="leve2 tocs-link" href="#另见">另见</a></div></div><div class="h1wrap-body"><div class="wrap"><div class="wrap-header h2wrap"><h2 id="homebrew"><a aria-hidden="true" tabindex="-1" href="#homebrew"><span class="icon icon-link"></span></a>Homebrew</h2><div class="wrap-body">
|
||||
</div></div><div class="h2wrap-body"><div class="wrap row-span-3"><div class="wrap-header h3wrap"><h3 id="安装"><a aria-hidden="true" tabindex="-1" href="#安装"><span class="icon icon-link"></span></a>安装</h3><div class="wrap-body">
|
||||
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" href="#homebrew">Homebrew</a><a aria-hidden="true" class="leve3 tocs-link" href="#安装">安装</a><a aria-hidden="true" class="leve3 tocs-link" href="#命令">命令</a><a aria-hidden="true" class="leve3 tocs-link" href="#更多包命令">更多包命令</a><a aria-hidden="true" class="leve3 tocs-link" href="#brew-cask-命令">Brew Cask 命令</a><a aria-hidden="true" class="leve3 tocs-link" href="#全局命令">全局命令</a><a aria-hidden="true" class="leve3 tocs-link" href="#brew-清理">Brew 清理</a><a aria-hidden="true" class="leve3 tocs-link" href="#brew-源码仓库">brew 源码仓库</a><a aria-hidden="true" class="leve3 tocs-link" href="#搜索查看">搜索查看</a><a aria-hidden="true" class="leve3 tocs-link" href="#帮助命令">帮助命令</a><a aria-hidden="true" class="leve2 tocs-link" href="#另见">另见</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="homebrew"><a aria-hidden="true" tabindex="-1" href="#homebrew"><span class="icon icon-link"></span></a>Homebrew</h2><div class="wrap-body">
|
||||
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist row-span-3"><div class="wrap-header h3wrap"><h3 id="安装"><a aria-hidden="true" tabindex="-1" href="#安装"><span class="icon icon-link"></span></a>安装</h3><div class="wrap-body">
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
<pre class="wrap-text "><code class="language-bash code-highlight"><span class="code-line">/bin/bash <span class="token parameter variable">-c</span> <span class="token string">"<span class="token variable"><span class="token variable">$(</span><span class="token function">curl</span> <span class="token parameter variable">-fsSL</span> https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh<span class="token variable">)</span></span>"</span>
|
||||
</span></code></pre>
|
||||
@ -60,7 +60,7 @@
|
||||
</span><span class="code-line">/bin/bash <span class="token parameter variable">-c</span> <span class="token string">"<span class="token variable"><span class="token variable">$(</span><span class="token function">curl</span> <span class="token parameter variable">-fsSL</span> https://raw.githubusercontent.com/Homebrew/install/master/install.sh<span class="token variable">)</span></span>"</span>
|
||||
</span></code></pre>
|
||||
<!--rehype:className=wrap-text -->
|
||||
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="命令"><a aria-hidden="true" tabindex="-1" href="#命令"><span class="icon icon-link"></span></a>命令</h3><div class="wrap-body">
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="命令"><a aria-hidden="true" tabindex="-1" href="#命令"><span class="icon icon-link"></span></a>命令</h3><div class="wrap-body">
|
||||
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@
|
||||
|
||||
|
||||
<table><thead><tr><th align="left"><code>brew switch git 2.5.0</code></th><th align="left">更改版本</th></tr></thead><tbody><tr><td align="left"><code>brew list --versions git</code></td><td align="left">看看你有什么版本</td></tr></tbody></table>
|
||||
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="更多包命令"><a aria-hidden="true" tabindex="-1" href="#更多包命令"><span class="icon icon-link"></span></a>更多包命令</h3><div class="wrap-body">
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="更多包命令"><a aria-hidden="true" tabindex="-1" href="#更多包命令"><span class="icon icon-link"></span></a>更多包命令</h3><div class="wrap-body">
|
||||
|
||||
|
||||
|
||||
@ -150,7 +150,7 @@
|
||||
|
||||
|
||||
<table><thead><tr><th align="left">命令</th><th align="left">说明</th></tr></thead><tbody><tr><td align="left"><code>brew info git</code></td><td align="left">列出版本、注意事项等</td></tr><tr><td align="left"><code>brew cleanup git</code></td><td align="left">删除旧版本</td></tr><tr><td align="left"><code>brew edit git</code></td><td align="left">编辑此软件包</td></tr><tr><td align="left"><code>brew cat git</code></td><td align="left">打印这个软件包</td></tr><tr><td align="left"><code>brew home git</code></td><td align="left">打开主页</td></tr><tr><td align="left"><code>brew search git</code></td><td align="left">搜索公式</td></tr></tbody></table>
|
||||
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="brew-cask-命令"><a aria-hidden="true" tabindex="-1" href="#brew-cask-命令"><span class="icon icon-link"></span></a>Brew Cask 命令</h3><div class="wrap-body">
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="brew-cask-命令"><a aria-hidden="true" tabindex="-1" href="#brew-cask-命令"><span class="icon icon-link"></span></a>Brew Cask 命令</h3><div class="wrap-body">
|
||||
|
||||
|
||||
|
||||
@ -170,7 +170,7 @@
|
||||
|
||||
<table><thead><tr><th align="left">命令</th><th align="left">说明</th></tr></thead><tbody><tr><td align="left"><code>brew install --cask firefox</code></td><td align="left">安装火狐浏览器</td></tr><tr><td align="left"><code>brew list --cask</code></td><td align="left">列出已安装应用</td></tr></tbody></table>
|
||||
<p>Cask 命令用于与图形应用程序交互</p>
|
||||
</div></div></div><div class="wrap row-span-2"><div class="wrap-header h3wrap"><h3 id="全局命令"><a aria-hidden="true" tabindex="-1" href="#全局命令"><span class="icon icon-link"></span></a>全局命令</h3><div class="wrap-body">
|
||||
</div></div></div><div class="wrap h3body-not-exist row-span-2"><div class="wrap-header h3wrap"><h3 id="全局命令"><a aria-hidden="true" tabindex="-1" href="#全局命令"><span class="icon icon-link"></span></a>全局命令</h3><div class="wrap-body">
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
|
||||
@ -210,13 +210,13 @@
|
||||
|
||||
|
||||
<table><thead><tr><th align="left">命令</th><th align="left">说明</th></tr></thead><tbody><tr><td align="left"><code>brew update</code></td><td align="left">更新 <code>brew</code> 和 <code>cask</code></td></tr><tr><td align="left"><code>brew upgrade</code></td><td align="left">升级所有软件包</td></tr><tr><td align="left"><code>brew list</code></td><td align="left">已安装列表</td></tr><tr><td align="left"><code>brew outdated</code></td><td align="left">升级需要什么?</td></tr><tr><td align="left"><code>brew doctor</code></td><td align="left">诊断冲泡问题</td></tr><tr><td align="left"><code>brew pin <formula></code></td><td align="left">防止指定软件包升级</td></tr><tr><td align="left"><code>brew unpin <formula></code></td><td align="left">允许升级指定的软件包</td></tr></tbody></table>
|
||||
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="brew-清理"><a aria-hidden="true" tabindex="-1" href="#brew-清理"><span class="icon icon-link"></span></a>Brew 清理</h3><div class="wrap-body">
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="brew-清理"><a aria-hidden="true" tabindex="-1" href="#brew-清理"><span class="icon icon-link"></span></a>Brew 清理</h3><div class="wrap-body">
|
||||
<pre class="language-bash"><code class="language-bash code-highlight"><span class="code-line">$ brew cleanup <span class="token comment"># 删除旧版本的已安装软件包</span>
|
||||
</span><span class="code-line">$ brew cleanup <span class="token operator"><</span>formula<span class="token operator">></span> <span class="token comment"># 删除旧版本指定软件包</span>
|
||||
</span><span class="code-line"><span class="token comment"># 显示所有将被删除的软件包(试运行)</span>
|
||||
</span><span class="code-line">$ brew cleanup <span class="token parameter variable">-n</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="brew-源码仓库"><a aria-hidden="true" tabindex="-1" href="#brew-源码仓库"><span class="icon icon-link"></span></a>brew 源码仓库</h3><div class="wrap-body">
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="brew-源码仓库"><a aria-hidden="true" tabindex="-1" href="#brew-源码仓库"><span class="icon icon-link"></span></a>brew 源码仓库</h3><div class="wrap-body">
|
||||
<pre class="language-bash"><code class="language-bash code-highlight"><span class="code-line"><span class="token comment"># 列出所有当前点击的源码仓库(点击)</span>
|
||||
</span><span class="code-line">$ brew tap
|
||||
</span><span class="code-line"><span class="token comment"># 使用 https 从 Github 中点击软件包源码仓库以点击</span>
|
||||
@ -227,7 +227,7 @@
|
||||
</span><span class="code-line"><span class="token comment"># 从存储库中删除给定的源码仓库</span>
|
||||
</span><span class="code-line">$ brew untap <span class="token operator"><</span>user/repo<span class="token operator">></span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="搜索查看"><a aria-hidden="true" tabindex="-1" href="#搜索查看"><span class="icon icon-link"></span></a>搜索查看</h3><div class="wrap-body">
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="搜索查看"><a aria-hidden="true" tabindex="-1" href="#搜索查看"><span class="icon icon-link"></span></a>搜索查看</h3><div class="wrap-body">
|
||||
<pre class="language-bash"><code class="language-bash code-highlight"><span class="code-line"><span class="token comment"># 列出所有已安装的软件包</span>
|
||||
</span><span class="code-line">$ brew list
|
||||
</span><span class="code-line"><span class="token comment"># 显示所有本地可用的 brew 配方</span>
|
||||
@ -237,7 +237,7 @@
|
||||
</span><span class="code-line"><span class="token comment"># 显示有关软件包的信息</span>
|
||||
</span><span class="code-line">$ brew info <span class="token operator"><</span>formula<span class="token operator">></span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="帮助命令"><a aria-hidden="true" tabindex="-1" href="#帮助命令"><span class="icon icon-link"></span></a>帮助命令</h3><div class="wrap-body">
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="帮助命令"><a aria-hidden="true" tabindex="-1" href="#帮助命令"><span class="icon icon-link"></span></a>帮助命令</h3><div class="wrap-body">
|
||||
|
||||
|
||||
|
||||
@ -256,7 +256,7 @@
|
||||
|
||||
|
||||
<table><thead><tr><th align="left">命令</th><th align="left">说明</th></tr></thead><tbody><tr><td align="left"><code>brew help</code></td><td align="left">打印帮助信息</td></tr><tr><td align="left"><code>brew help <sub-command></code></td><td align="left">打印子命令的帮助信息</td></tr></tbody></table>
|
||||
</div></div></div></div></div><div class="wrap"><div class="wrap-header h2wrap"><h2 id="另见"><a aria-hidden="true" tabindex="-1" href="#另见"><span class="icon icon-link"></span></a>另见</h2><div class="wrap-body">
|
||||
</div></div></div></div></div><div class="wrap h2body-not-exist"><div class="wrap-header h2wrap"><h2 id="另见"><a aria-hidden="true" tabindex="-1" href="#另见"><span class="icon icon-link"></span></a>另见</h2><div class="wrap-body">
|
||||
<ul>
|
||||
<li><a href="https://brew.sh/index_zh-cn">Homebrew 官网</a> <em>(brew.sh)</em></li>
|
||||
<li><a href="https://github.com/Homebrew/brew">Homebrew brew 源码</a> <em>(github.com)</em></li>
|
||||
@ -275,8 +275,6 @@ function anchorPoint() {
|
||||
Array.from(document.querySelectorAll('.h2wrap-body .wrap')).forEach((elm) => elm.classList.remove('active'))
|
||||
if (elm?.tagName === 'H3') {
|
||||
elm?.parentElement?.parentElement?.classList.add('active');
|
||||
const box = elm?.parentElement?.parentElement;
|
||||
console.log('elm:2', box, document.querySelectorAll('.h2wrap-body .wrap'))
|
||||
}
|
||||
}
|
||||
anchorPoint();
|
||||
@ -287,7 +285,6 @@ function updateAnchor(element) {
|
||||
tocanchor.classList.remove('is-active-link');
|
||||
});
|
||||
const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`);
|
||||
console.log('anchor', anchor)
|
||||
if (anchor) {
|
||||
anchor.classList.add('is-active-link');
|
||||
}
|
||||
|
Reference in New Issue
Block a user