📜  过滤按钮反应 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:01.592000             🧑  作者: Mango

代码示例2
var A = polls.filter(e => e.type === "A")
var B = polls.filter(e => e.type === "B")
var C = polls.filter(e => e.type === "C")    


function showA() {
    setfilteredPolls(A)
}

function showB() {
    setfilteredPolls(B)
}

function showC() {
    setfilteredPolls(C)
}