react 使用localStorage

俞子实
2023-12-01

const storage=window.localStorage;

if(storage!=undefined){

if(storage.hasOwnProperty("cid")&&storage.getItem("cid")>0){

this.setState({

toogle:false

})

}

}else{

this.setState({

toogle:true

})

}

}

 类似资料: