search

Home  >  Q&A  >  body text

javascript - vue causes error when using ref


I would like to ask, what is the reason for the error?

高洛峰高洛峰2768 days ago932

reply all(3)I'll reply

  • 習慣沉默

    習慣沉默2017-06-12 09:30:54

    has nothing to do with ref. The error message says that the splice method is not defined during render.

    The splice method is the method of Array/array. The description is probably asking for props of type array, but you didn't give it.

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-06-12 09:30:54

    The reason for the error is that the object you should operate on is not an array. As for the relationship with ref, it is not clear from the picture you provided

    reply
    0
  • 为情所困

    为情所困2017-06-12 09:30:54

    <form v-model="yourModel" ref="yourModel">
       <input v-model="yourModel.value" type="text">
    </form>
    
    <script>
       this.$refs.yourModel
    </script>

    I usually use it like this, XD

    reply
    0
  • Cancelreply