Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
docs: upgrade docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jikkai committed Aug 14, 2019
1 parent 7f2b465 commit 6ee951a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
27 changes: 25 additions & 2 deletions example/components/header.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
<header class="sr-header">
<Link to="/">
<h1>Svelte Router</h1>
<h1>
Svelte Router
<sup>{version}</sup>
</h1>
</Link>

<a href="https://github.com/jikkai/svelte-router">Github</a>
</header>

<script>
import { Link } from '../../src'
import { onMount } from 'svelte'
import SvelteRouter, { Link } from '../../src'
let version
onMount(() => {
version = SvelteRouter.__VERSION__
})
</script>

<style>
Expand All @@ -15,11 +27,22 @@
display: flex;
align-items: center;
box-shadow: 0 0 15px 0 rgba(0, 0, 0, .05);
display: flex;
justify-content: space-between;
align-items: center;
}
.sr-header h1 {
margin: 0;
font-size: 24px;
font-weight: 300;
}
.sr-header sup {
padding: 2px 4px;
color: var(--white);
font-size: 14px;
background: var(--primary);
border-radius: 4px;
}
</style>
2 changes: 1 addition & 1 deletion example/components/menu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<span>Component</span>
<ul>
<li>
<Link to="/component/router-link" replace>Link</Link>
<Link to="/component/link" replace>Link</Link>
</li>
</ul>
</div>
Expand Down
10 changes: 10 additions & 0 deletions example/docs/component/Link.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,13 @@
| replace | `boolean` | `false` |
| className | `string` | `''` |
| activeClassName | `string` | `'router-link-active'` |

## Example

```html
<Link to="/foo">go Foo</Link>

<script>
import { Link } from 'svelte-router'
</script>
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svelte-router",
"version": "3.0.0-alpha.0",
"version": "3.0.0-alpha.1",
"description": "A simple router for Svelte",
"main": "lib/svelte-router.js",
"author": "Jikkai Xiao <[email protected]>",
Expand Down

0 comments on commit 6ee951a

Please sign in to comment.