Vue.js realizes the specification selection function of commodity details page.

vue.js implements specification selection on product details page
Click to select version option and click to select color option. Highlight has been selected. How to display the selected version and color

html Code
< div class= "chose-ck" >

: {{Checkbox}}

< / div >
< div class= "chose-ck" vmurf = "(item,index2) in colors": key= "index2" >

{{item.name}}


< dt vsway forr = "(item2,index) in item.childsCurGoods": key= "index": class= "{"check":index = iac [index2]}": id= "item.id" @ click= "chek (index2,index,$event)" >

{{item2.name}}
</dt>

< / div >
javascript

        chek(index2, index, $event) {
            this.iac[index2] = index
            this.iac = this.iac.concat([]);
        },

how to display the selected version and color


both for loops can get the currently selected value, so you can know the name, of the selected value. You can bind the selected name value to checkbox

.
Menu