我有 2 个下拉列表,但彼此之间不会有任何关系。我想根据第一个下拉列表的选择隐藏或禁用第二个下拉列表中的元素。
这是小提琴链接,当我在一个下拉列表中选择类型时,您可以看到它在其他下拉列表中显示相关的汽车。在小提琴中,您可以看到数据声明如下
filters: ["None", "Old", "New", "Super"],
items: [{ name: "Corvette", type: "Old"},
{ name: "Charger", type: "Old"},
{ name: "Prius", type: "New"},
{ name: "Magnum", type: "New"},
{ name: "McLaren", type: "Super"},
{ name: "Saleen", type: "Super"}]
您将看到这两个数组之间存在关系。但在我的实际场景中,彼此之间不会有如下关系
// Mydata will be like
filters: ["None", "Old", "New", "Super"],
items: [{ name: "Corvette", type: "Old"},
{ name: "Charger"},
{ name: "Prius"},
{ name: "Magnum"},
{ name: "McLaren"},
{ name: "Saleen"}]
我怎样才能在淘汰赛中做到这一点?