简体   繁体   中英

Appending a link title as a query parameter in the url once redirected to a new page

I have a table where several names are their own links and once clicked, it redirects to my landing page.

<a href="#/landing"><span>{{ link.linktitle }}</span></a>

That part works fine.

However, I need the url to look like this once redirect to the landing page:

http://localhost:3000/#/landing/?=link={link title}

Is there a simple way to achieve this?

PS. I also need to grab the link title from the query param and have it display somewhere on the landing page.

Thanks!

If the value you want to have is stored in the JS side under link.linktitle , your code has to look like this:

<a href="#/landing/?=link={{ link.linktitle }}">
    <span>{{ link.linktitle }}</span>
</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM