A breadcrumb navigation function that encapsulates a separate component. When you close the current tab, you need to jump to the previous path.
I consider passing history
when the parent invokes this component, and then I can jump through history.push ()
.
then I think of the problem of data persistence, so I intend to save history
to localStorage
,
but because JSON.stringify (function.)
will put the method body Filter:
ECMASCript officials have also specially emphasized this point:
It does not attempt to impose ECMAScript" s internal data representations on other programming languages. Instead, it shares a small subset of ECMAScript" s textual representations with all other programming languages.
so I"d like to ask:
- how do I store the method body in
localStorage
? - if you don"t save
localStorage
, is there any way to save this kind of data for a long time?