<h3 dir="auto">What problem does this feature solve?</h3>
<p dir="auto">This feature will allow to do validation based on the value of other properties.</p>
<h3 dir="auto">What does the proposed API look like?</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Vue.component('my-component', {
  props: {
    propA: 'String',
    propB: {
      validator(value, props) {
        switch(props.propA) {
          case 'email':
            return validEmail(value)
          case 'tel':
            return validTel(value)
          default:
            return true
        }
      }
    } 
  }
})"><pre class="notranslate"><span class="pl-v">Vue</span><span class="pl-kos">.</span><span class="pl-en">component</span><span class="pl-kos">(</span><span class="pl-s">'my-component'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
  <span class="pl-c1">props</span>: <span class="pl-kos">{</span>
    <span class="pl-c1">propA</span>: <span class="pl-s">'String'</span><span class="pl-kos">,</span>
    <span class="pl-c1">propB</span>: <span class="pl-kos">{</span>
      <span class="pl-en">validator</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">,</span> <span class="pl-s1">props</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">switch</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">.</span><span class="pl-c1">propA</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
          <span class="pl-k">case</span> <span class="pl-s">'email'</span>:
            <span class="pl-k">return</span> <span class="pl-en">validEmail</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span>
          <span class="pl-k">case</span> <span class="pl-s">'tel'</span>:
            <span class="pl-k">return</span> <span class="pl-en">validTel</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span>
          <span class="pl-k">default</span>:
            <span class="pl-k">return</span> <span class="pl-c1">true</span>
        <span class="pl-kos">}</span>
      <span class="pl-kos">}</span>
    <span class="pl-kos">}</span> 
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<h3 dir="auto">Version</h3>
<p dir="auto">2.6.10</p>
<h3 dir="auto">Reproduction link</h3>
<p dir="auto"><a href="https://codepen.io/leevscript/pen/gOawPgP" rel="nofollow">https://codepen.io/leevscript/pen/gOawPgP</a></p>
<h3 dir="auto">Steps to reproduce</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;template&gt;
  &lt;ul&gt;
    &lt;li v-for=&quot;num in nums&quot; :key=&quot;num&quot;&gt;{{num}}&lt;/li&gt;
  &lt;/ul&gt;
&lt;/template&gt;

&lt;script&gt;
  export default {
    data () {
      return {
        nums: [1, 2, 3]
      }
    },
    mounted () {
      this.nums = [2, 2]
    }
  }
&lt;/script&gt;"><pre class="notranslate"><code class="notranslate">&lt;template&gt;
  &lt;ul&gt;
    &lt;li v-for="num in nums" :key="num"&gt;{{num}}&lt;/li&gt;
  &lt;/ul&gt;
&lt;/template&gt;

&lt;script&gt;
  export default {
    data () {
      return {
        nums: [1, 2, 3]
      }
    },
    mounted () {
      this.nums = [2, 2]
    }
  }
&lt;/script&gt;
</code></pre></div>
<h3 dir="auto">What is expected?</h3>
<p dir="auto">normal</p>
<h3 dir="auto">What is actually happening?</h3>
<p dir="auto">error</p>
<hr>
<p dir="auto">英文不太好，问题又比较复杂，所以就用中文了，抱歉。<br>
当 oldCh 里的元素跟 newCh 里的元素匹配到且该元素不在 oldCh 的首尾且 newCh 里该元素有多个时，diff 算法会报错。<br>
我知道 key 应该是唯一标识，但我理解这种情况不应该报错，因为很多数据由服务端返回，我们不能保证不会有重复元素。</p>