Anchor tag point to page
Opened this issue · 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 #to
s. Also pointing to the current page but under a different URL argument would require #21