diff options
Diffstat (limited to 'docs/guide/components/page-title/index.md')
-rw-r--r-- | docs/guide/components/page-title/index.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/guide/components/page-title/index.md b/docs/guide/components/page-title/index.md new file mode 100644 index 00000000..b51ab640 --- /dev/null +++ b/docs/guide/components/page-title/index.md @@ -0,0 +1,23 @@ +# 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). |