Skip to content

Commit 57daead

Browse files
readme updates
1 parent b49ab7f commit 57daead

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Type safe router for Vue.js
1111

1212
## Getting Started
1313

14-
Get Started with our [documentation](https://kitbag-router.netlify.app/) or our [intro video](https://kitbag-router.netlify.app/)
14+
Get started with our [documentation](https://kitbag-router.netlify.app/) or watch our [intro video](https://kitbag-router.netlify.app/)
1515

1616
## Installation
1717

@@ -37,7 +37,7 @@ const About = { template: '<div>About</div>' }
3737

3838
export const routes = [
3939
createRoute({ name: 'home', path: '/', component: Home }),
40-
createRoute({ name: 'path', path: '/about', component: About }),
40+
createRoute({ name: 'about', path: '/about', component: About }),
4141
] as const
4242
```
4343

@@ -48,7 +48,7 @@ Create a router instance and pass it to the app as a plugin
4848
```ts
4949
import { createApp } from 'vue'
5050
import { createRouter } from '@kitbag/router'
51-
import { routes } from '/routes'
51+
import { routes } from './routes'
5252
import App from './App.vue'
5353

5454
const router = createRouter(routes)
@@ -98,7 +98,7 @@ const settings = createRoute({
9898
component: defineAsyncComponent(() => import('./SettingsPage.vue')),
9999
})
100100

101-
const router = useRouter([user, profile, settings])
101+
const router = useRouter()
102102

103103
router.push('settings')
104104
```
@@ -110,7 +110,7 @@ router.push('/user/settings')
110110
router.push('https://github.com/kitbagjs/router')
111111
```
112112

113-
This `source` argument is type safe, expecting either a [`Url`](/api/types/Url) or a valid route [`name`](/api/types/Route#name). URL is any string that starts with "http", "https", or a forward slash "/". Additionally if using the route name, push will require params be passed in if there are any.
113+
The `source` argument is type safe, expecting either a URL string or a valid route name. URLs are strings that start with "http", "https", or a forward slash "/". When using route names, push will require params if the route has any.
114114

115115
## Update
116116

@@ -133,13 +133,14 @@ router.route.update({
133133

134134
Give your route components a place to be mounted
135135

136-
```html {4-5}
136+
```html
137137
<!-- App.vue -->
138-
<div class="app">
139-
...
140-
<!-- matched route.component gets rendered here -->
141-
<router-view />
142-
</div>
138+
<template>
139+
<div class="app">
140+
<!-- matched route.component gets rendered here -->
141+
<router-view />
142+
</div>
143+
</template>
143144
```
144145

145146
This component can be mounted anywhere you want route components to be mounted. Nested routes can also have a nested `RouterView` which would be responsible for rendering any children that route may have. Read more about [nested routes](https://kitbag-router.netlify.app/core-concepts/defining-routes#nested-routes).
@@ -148,11 +149,10 @@ This component can be mounted anywhere you want route components to be mounted.
148149

149150
Use RouterLink for navigating between routes.
150151

151-
```html {3-4}
152+
```html
152153
<template>
153-
...
154154
<!-- router-link renders as <a> with href -->
155-
<router-link :to="(resolve) => resolve('home')">Go somewhere</router-link>
155+
<router-link :to="(resolve) => resolve('home')">Go Home</router-link>
156156
</template>
157157
```
158158

0 commit comments

Comments
 (0)