오윤석

character page 추가

1 import Search from './routes/Search.svelte'; 1 import Search from './routes/Search.svelte';
2 +import Character from './routes/Character.svelte';
2 3
3 const routes = { 4 const routes = {
4 '/': Search, 5 '/': Search,
6 + '/character': Character,
7 + '/character/:character': Character,
5 }; 8 };
6 9
7 export default routes; 10 export default routes;
...\ No newline at end of file ...\ No newline at end of file
......
1 +<script>
2 + export let params = {};
3 +
4 + import {push} from 'svelte-spa-router';
5 +
6 + function init() {
7 + if(!params.character) {
8 + M.toast({html:"캐릭터명을 입력해주세요."});
9 + push("/");
10 + }
11 + }
12 +
13 + init();
14 +</script>
15 +
16 +<svelte:head>
17 +
18 +</svelte:head>
...\ No newline at end of file ...\ No newline at end of file