iamstevendao/vue-suggestion

Type check failed for prop "minLen"

eugeene opened this issue · 3 comments

When I use minLen or maxLen, I get this message:

vue.js:634 [Vue warn]: Invalid prop: type check failed for prop "minLen". Expected Number with value 5, got String with value "5".


Vue.component("frm-product-suggest", {
    template: `
    <span class="inp__fix">
        <input type="hidden" name="product_id" :value="id" required>
        <vue-suggestion 
            inputClasses="inp__text"
            placeholder="Napište model, nebo značku zboží"
            v-model="product" 
            minLen=5
            :itemTemplate="tpl"
            :items="searchResult" 
            :setLabel="setLabel"
            @changed="onSearch" 
            @selected="onSelected">
        </vue-suggestion>
    </span>`
})

Any ideas? Thanx!

when i use :minLen=5 it works, but @Changed is called every time the input changes, so I have to check the input parameter for length.

@eugeene Sorry I don't understand what you meant by this part:

when i use :minLen=5 it works, but @Changed is called every time the input changes, so I have to check the input parameter for length.

@eugeene to pass a number you need to use :minLen="5"