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
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}`);
},
};