Want to use vue to achieve color exclusivity of commodity specifications, want three or three corresponding exclusivity

background object is like this

jquery
vue span


Mar.02,2021

two options:
(1) you reassemble the data returned by the background and assemble it into the form of
memory: [{name: '8GB, active: false}, {name:' 16Gateway, active: false},.]
.
then @ click= "changeItem (items, k)"; method: changeItem (items, item) {loop items, to remove active;item.active =! item.active}

< hr >

(2) defines three variables, namely selected memory, selected color, selected screen,
and then @ click= "selectItem (index, k)"; method: selectItem (key, item) {if (key = 'memory') {selected memory = item;} else if. }
modify: class= "{active: (index = 'memory' & & k = selected memory) | | (index = 'color' & & k = selected color) | |.}"

do well with the first method

Menu