【发布时间】:2021-11-16 02:26:06
【问题描述】:
如何在获取事件后使用 mui 隐藏/显示 react 中的列。
以 fetch 为例:
const getData=()=>{
fetch(url +'/rha/apicall/getData/'
,{
headers : {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
}
)
.then(function(response){
enqueueSnackbar('Data Loaded',{variant:'info'});
return response.json();
})
.then(function(myJson) {
console.log(myJson);
console.log(columns);
columns[1].hide=false;
rows = myJson.adh;
setData(myJson)
});
}
行更新良好,但列不工作。
【问题讨论】:
-
请。为您的组件提供 Column,以便社区知道如何提供帮助,无需猜测
-
这无关紧要。列名对问题没有影响。顺便说一句,这些列非常大。
标签: reactjs mui-datatable