doc: upate vue2.md (#122)

v-for和v-if不推荐一起使用,效率较低.推荐使用computed计算属性.
当两者一起使用时v-for具有较高的优先级. 03d4aedc3d
This commit is contained in:
jaywcjlove
2022-11-18 02:53:43 +00:00
parent 26e0ce4a8c
commit e3e04ebe49
3 changed files with 29 additions and 26 deletions

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@ -467,6 +467,7 @@
</span><span class="code-line"><span class="token tag"><span class="token tag"><span class="token punctuation">&#x3C;/</span>div</span><span class="token punctuation">></span></span> </span><span class="code-line"><span class="token tag"><span class="token tag"><span class="token punctuation">&#x3C;/</span>div</span><span class="token punctuation">></span></span>
</span></code></pre> </span></code></pre>
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="v-forv-if"><a aria-hidden="true" tabindex="-1" href="#v-forv-if"><span class="icon icon-link"></span></a>v-for/v-if</h3><div class="wrap-body"> </div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="v-forv-if"><a aria-hidden="true" tabindex="-1" href="#v-forv-if"><span class="icon icon-link"></span></a>v-for/v-if</h3><div class="wrap-body">
<p><a href="https://v2.cn.vuejs.org/v2/guide/conditional.html">v-for和v-if不推荐一起使用</a></p>
<pre class="language-html"><code class="language-html code-highlight"><span class="code-line"><span class="token tag"><span class="token tag"><span class="token punctuation">&#x3C;</span>li</span> <pre class="language-html"><code class="language-html code-highlight"><span class="code-line"><span class="token tag"><span class="token tag"><span class="token punctuation">&#x3C;</span>li</span>
</span></span><span class="code-line highlight-line"><span class="token tag"> <span class="token attr-name">v-for</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>todo in todos<span class="token punctuation">"</span></span> </span></span><span class="code-line highlight-line"><span class="token tag"> <span class="token attr-name">v-for</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>todo in todos<span class="token punctuation">"</span></span>
</span></span><span class="code-line highlight-line"><span class="token tag"> <span class="token attr-name">v-if</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>!todo.isComplete<span class="token punctuation">"</span></span> </span></span><span class="code-line highlight-line"><span class="token tag"> <span class="token attr-name">v-if</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>!todo.isComplete<span class="token punctuation">"</span></span>

View File

@ -458,12 +458,12 @@
<a href="https://github.com/Jack-Zhang-1314" title="fw_qaq"> <a href="https://github.com/Jack-Zhang-1314" title="fw_qaq">
<img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fw_qaq"> <img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fw_qaq">
</a> </a>
<a href="https://github.com/expoli" title="expoli">
<img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli">
</a>
<a href="https://github.com/mofelee" title="mofelee"> <a href="https://github.com/mofelee" title="mofelee">
<img src="https://avatars.githubusercontent.com/u/5069410?v=4" width="42;" alt="mofelee"> <img src="https://avatars.githubusercontent.com/u/5069410?v=4" width="42;" alt="mofelee">
</a> </a>
<a href="https://github.com/expoli" title="expoli">
<img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli">
</a>
<a href="https://github.com/partoneplay" title="partoneplay"> <a href="https://github.com/partoneplay" title="partoneplay">
<img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay"> <img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay">
</a> </a>
@ -562,7 +562,7 @@
<!--rehype:class=home-card&style=margin:1.2rem 0;display: flex;justify-content: center;--> <!--rehype:class=home-card&style=margin:1.2rem 0;display: flex;justify-content: center;-->
<p>如果你有资源,可以很方便部署 web 版,这非常简单,只需要克隆 gh-pages 分支代码到你的静态服务就可以了,还可以使用 <a href="https://hub.docker.com/r/wcjiang/reference">docker</a> 快捷部署 web 版。</p> <p>如果你有资源,可以很方便部署 web 版,这非常简单,只需要克隆 gh-pages 分支代码到你的静态服务就可以了,还可以使用 <a href="https://hub.docker.com/r/wcjiang/reference">docker</a> 快捷部署 web 版。</p>
</div></div><div class="h2wrap-body"></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 Kenny Wang. Updated on 2022/11/18 01:05:27</footer></footer><script> </div></div><div class="h2wrap-body"></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 Kenny Wang. Updated on 2022/11/18 02:53:00</footer></footer><script>
if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) {
window.onhashchange = function () { window.onhashchange = function () {
anchorPoint() anchorPoint()