summaryrefslogtreecommitdiff
path: root/docs/guide/components/page-title/index.md
blob: db43f29f0c49cdf207b03b0e31b5cb7b2cb6b5a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Page title
The `<page-title>` component will automatically render the page title that
corresponds with the title property set in the route record's meta field in
`src/router/routes.js`.

```js
// src/router/routes.js
  {
    path: '',
    name: 'login',
    component: Login,
    meta: {
      title: i18n.t('appPageTitle.login'),
    },
  },
```

Optional page descriptions can be included by using the description prop
`:description` prop and passing in the i18n localized text string. Translations
are found in the `src/locales` folder.

``` vue
// Example: `src/views/AccessControl/Ldap/Ldap.vue`
  <page-title :description="$t('pageLdap.pageDescription')" />
```

[View the page title component source
code](https://github.com/openbmc/webui-vue/blob/master/src/components/Global/PageTitle.vue).