Error binding calculation property in vue

html

<input :type="inputType"
       :id="getId()"
       :name="getId(false)"
       :class="inputType"
       :value="item.propertyValueId"
       @click="handleCheck"
       v-model="checkedIdList"
       v-validate="{
            required: attribute.required
       }"/>
<label :for="getId(false)" :title="item.valueData" class="ell">{{ item.valueData }}</label>
 
 props: {
    // 
    checkedList: {
        type: [Array, Number] ,
        default: function () {
            // return []
        }
    }
},

:
checkedIdList: {
    get() {
        return this.checkedList
    },
    set(val) {
        this.checkedIdList = val
    }
},
Mar.10,2021

what do you want to achieve? Hasn't v-model already implemented two-way binding?


you have this property get in the setter of a property, and of course there will be a stack overflow.

checkedIdList: {
    get() {
        return this.checkedList
    },
    set(val) {
        this.checkedIdList = val
    }
}
Menu