AlexxNB / tinro

Highly declarative, tiny, dependency free router for Svelte's web applications.
MIT License
675 stars 30 forks source link

Support for <Route ignore> #11

Closed ckiee closed 4 years ago

ckiee commented 4 years ago

I have a link that goes to /api/auth and this request would usually go to the API but tinro catches that. I'd like to be able to do this and I tried to make a PR but I don't understand the code very well yet:

<Route path="/api/*" ignore />

Alternative name

AlexxNB commented 4 years ago

The question is how to avoid certain URLs in the <a> to be passed into tinro?

AlexxNB commented 4 years ago

I think it may be like this: <a href="/api/auth" data-tinro-ignore>To API</a>

ckiee commented 4 years ago

Yeah, that'd work too

AlexxNB commented 4 years ago

Ok, I'll implement it in future version.

ckiee commented 4 years ago

Awesome, thanks. By the way, for now I forked tinro and changed the regex to disallow /api

AlexxNB commented 4 years ago

Added in v.0.2.5 Read here how to use it.

ckiee commented 4 years ago

Cool, thanks

AlexxNB commented 4 years ago

Please update to v.0.2.7. there was a bug when tinro-ignore attribute being removed after first click.