title: Deleting an array item in Composition API
body: <p>I am trying to learn composition API and move away from options api as vue3 seems to be moving towards it. I am doing a simple example where a user enters in an input box the ticker and then the number of shares in the input box next to it. When you click off it adds it to the array of positions. However, I am trying to tie into the clear event on the input boxes and if you click the clear button then Quasar has a clear event it triggers. I am running a function deletePosition to delete that row which should update the array and delete that row. My issue however is this deletes all items in the array except the 0 index which is 'AAPL' stock. It does not matter how many positions I add it still does this unusual behavior. I am not sure why this keeps happening and its making me wonder should I not be using ref and should be using reactive or am I just missing something obvious?</p>
  <pre><code>&lt;template&gt;
    &lt;q-page class=&quot;flex flex-center&quot;&gt;
      &lt;form id=&quot;upload-stocks-form&quot; class=&quot;q-pa-xl&quot; method=&quot;post&quot;&gt;
        &lt;h1 class=&quot;text-h4 text-center&quot;&gt;Add Positions&lt;/h1&gt;
        &lt;div class=&quot;row q-col-gutter-md&quot;&gt;
          &lt;template v-for=&quot;(item,index) in positionsArray&quot; :key=index&gt;
            &lt;div class=&quot;col-9&quot;&gt;
              &lt;q-input class=&quot;login-textbox grey-7&quot; filled v-model=&quot;item.StockSymbol&quot; @clear=&quot;deletePosition(index)&quot; label=&quot;Stock Symbol&quot; clearable&gt;
              &lt;/q-input&gt;
            &lt;/div&gt;
            &lt;div class=&quot;col-3&quot;&gt;
              &lt;q-input class=&quot;login-textbox grey-7&quot; filled v-model.number=&quot;item.ShareCount&quot; type=&quot;number&quot; label=&quot;Shares&quot;&gt;
              &lt;/q-input&gt;
            &lt;/div&gt;
          &lt;/template&gt;
          &lt;div class=&quot;col-9&quot;&gt;
              &lt;q-input class=&quot;login-textbox grey-7&quot; filled v-model=&quot;addStockSymbol&quot; label=&quot;Add New Stock Symbol&quot; @blur=&quot;addPosition&quot;&gt;
              &lt;/q-input&gt;
            &lt;/div&gt;
            &lt;div class=&quot;col-3&quot;&gt;
              &lt;q-input class=&quot;login-textbox grey-7&quot; filled v-model.number=&quot;addShareCount&quot; type=&quot;number&quot; label=&quot;Shares&quot; @blur=&quot;addPosition&quot;&gt;
              &lt;/q-input&gt;
            &lt;/div&gt;
          &lt;div class=&quot;col-12&quot;&gt;
            &lt;q-btn class=&quot;full-width q-pa-md q-mt-md&quot; color=&quot;orange-8&quot; label=&quot;Save&quot; /&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/form&gt;
    &lt;/q-page&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import {watch, ref, defineComponent} from 'vue'
  
  export default defineComponent({
    name: 'UploadPositions',
    components: {
      
    },
      setup () {
        //v-models
        const addStockSymbol = ref('')
        const addShareCount = ref('')
        const positionsArray = ref([{StockSymbol: 'AAPL', ShareCount: 4 },{StockSymbol: 'AMD', ShareCount: 10 }])
  
        //methods
        const addPosition = () =&gt; { 
          if((addStockSymbol.value != null &amp;&amp; addStockSymbol.value != '') &amp;&amp; (addShareCount.value != null &amp;&amp; addShareCount.value != '')){
            positionsArray.value.push({StockSymbol: addStockSymbol.value.toUpperCase(), ShareCount: addShareCount.value})
            addStockSymbol.value = null
            addShareCount.value = null
            console.log(positionsArray.value)
          }
        }
        const deletePosition = (index) =&gt; {
          positionsArray.value =  positionsArray.value.splice(index,1)
          console.log(positionsArray.value)
        }
  
      return {
        addStockSymbol, addShareCount, positionsArray, addPosition, deletePosition
      }
    }
  })
  &lt;/script&gt;
  </code></pre>