代码之家  ›  专栏  ›  技术社区  ›  Bear Bile Farming is Torture

如何在URL中提取标签?

  •  0
  • Bear Bile Farming is Torture  · 技术社区  · 4 年前
    www.app.com/home#tag_name
    

    在React中,如何提取 tag_name 在上面的网址?有没有内置的功能可以做到这一点?

    2 回复  |  直到 4 年前
        1
  •  1
  •   Antal Attila    4 年前

    这可能会有所帮助。 https://www.codegrepper.com/code-examples/javascript/get+url+hashtag+javascript

    窗地方hash='#hash_值';

    地方搞砸

        2
  •  0
  •   Bear Bile Farming is Torture    4 年前
    history.location.hash
    

    上述措施奏效了