Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Anchor tag point to page #23

Open
kaleidawave opened this issue Oct 27, 2020 · 0 comments
Open

Anchor tag point to page #23

kaleidawave opened this issue Oct 27, 2020 · 0 comments
Assignees
Labels
client-side-routing The routing done for SPA enhancement New feature or request templating Syntax around writing templates

Comments

@kaleidawave
Copy link
Owner

Currently to do client side routing you must manually point to a URL and add the relative attribute.

It would better if rather than having to point at a URL that you could point at a page component instead.

<template>
    <a #to="SomeOtherPage">Go to SomeOtherPage</a>
</template>

<script>
     import {SomeOtherPage} from "./someOtherPage.prism";
     class SomePage extends Component {}
</script>

At compile time this would transform the #to to a href and add the client side routing events.

For pages with dynamic URLs e.g. /some/path/:x pointing to the page would a function call e.g.: #to="PathWithDynamicPath(this.data.x)"

This would strongly bind URLs to pages and remove the lookup/guesswork with hooking up URLs to pages. Importing the component would be necessary.

Should be fairly easy to implement. There may be some problems with cyclic #tos. Also pointing to the current page but under a different URL argument would require #21

@kaleidawave kaleidawave added enhancement New feature or request client-side-routing The routing done for SPA templating Syntax around writing templates labels Oct 27, 2020
@kaleidawave kaleidawave self-assigned this Oct 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
client-side-routing The routing done for SPA enhancement New feature or request templating Syntax around writing templates
Projects
None yet
Development

No branches or pull requests

1 participant