feat(riot-v5): add config for router and register tag instead of import

This commit is contained in:
Joxit 2021-03-06 00:58:37 +01:00
parent 142727e8ac
commit ea21483346
No known key found for this signature in database
GPG key ID: F526592B8E012263
7 changed files with 49 additions and 20 deletions

14
src/scripts/router.js Normal file
View file

@ -0,0 +1,14 @@
import { route, router, getCurrentRoute } from '@riotjs/route';
function baseUrl() {
return getCurrentRoute().replace(/#!(.*)/, '');
}
export default {
home() {
router.pus(baseUrl());
},
taglist(image) {
router.push(`${baseUrl()}#!/taglist/${image}`);
},
};