1、about.svelte页面
a、使用 use:link
方式
<script> import {link} from 'svelte-spa-router'; </script> <div> 这里是about关于我们 </div> <div> <a href="/home" use:link >进入首页</a> </div>
2、routes路由
import home from "../pages/home.svelte"; import about from "../pages/about.svelte"; import error from "../pages/error.svelte"; import detail from "../pages/detail.svelte"; const routes= { "/": home, "/about": about, "/home": home, "/detail/:aboutId/type/:typeId": detail, "*": error, }; export default routes;
参考学习:https://github.com/ItalyPaleAle/svelte-spa-router
标签:about,01,..,detail,import,home,svelte,路由 From: https://www.cnblogs.com/zzming/p/17987076