prism icon indicating copy to clipboard operation
prism copied to clipboard

Anchor tag point to page

Open kaleidawave opened this issue 3 years ago • 0 comments

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 avatar Oct 27 '20 10:10 kaleidawave