Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
vinicius73 committed Jun 27, 2018
1 parent e644b30 commit bc2bedf
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Name | Type | Description
---- | ---- | -----------
suffix | String | suffix for the value of the page title tag
prefix | String | prefix for the value of the page title tag
router | [VueRouter instance](https://router.vuejs.org/api/#router-instance-properties) | if present, allows you to set the title via the route.

## Usage

Expand Down Expand Up @@ -79,3 +80,39 @@ export default {
title: ({ $t }) => $t('pages.clients.title')
}
```

## Vue Router usage
### Setup

```js
import Vue from 'vue'
import VuePageTitle from 'vue-page-title'

import router from 'path/to/application/router'

Vue.use(VuePageTitle, { router })
```

```js
// path/to/application/router
import FooComponent from 'path/to/foo-component'
import HomeComponent from 'path/to/home-component'

const routes = [{
path: '/',
component: HomeComponent,
meta: {
title: 'Home Page' // Title must be a string.
}
}, {
path: '/foo',
component: FooComponent,
meta: {
title: 'Foo Page'
}
}]

export default new VueRouter({
routes
})
```

0 comments on commit bc2bedf

Please sign in to comment.