题解 | #切换Tab栏目#
切换Tab栏目
http://www.nowcoder.com/practice/70916dc9292e470eb70ac2a0d3b9a404
options.onclick = function(e) {
optionItems.map((item, index) => {
if (index == e.target.getAttribute('data-type')) {
item.style.backgroundColor = '#25bb9b';
items[index].style.display = 'block';
} else {
item.style.backgroundColor = '#fff';
items[index].style.display = 'none';
}
})
}