Way to provide a unique ID for each input form generated by v-for in VueJS-PHP Chinese Network Q&A
Way to provide a unique ID for each input form generated by v-for in VueJS
P粉245276769
P粉245276769 2023-09-02 14:58:19
0
1
445

I'm trying to generate an input form for numbers (passed via props) and store the user input in the inputValues array. My code is as follows:

 export default defineComponent({ name: 'name', props: [ 'number', ], data() { return { inputValues: [] } } });

But nothing is stored in inputValues. What did i do wrong? Also, how do I give the input field a different id so that I can style it differently in CSS later?

Edit: I managed to get it working!

;

P粉245276769
P粉245276769

reply all (1)
P粉200138510

I managed to make it work. v-bind: or ":" should not be used with v-model. I added the index because n starts at 1 instead of 0.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!