pinafore/routes/_components/settings/SettingsNavItem.html

27 lines
535 B
HTML
Raw Normal View History

<a class="settings-nav-item {{getCurrentClass(page, name)}}"
aria-label={{getAriaLabel(page, name, label)}}
:href
>
2018-01-13 19:53:25 +01:00
{{label}}
</a>
<style>
a.settings-nav-item {
2018-01-13 19:53:25 +01:00
font-size: 1.2em;
}
a.settings-nav-item.selected {
2018-01-13 19:53:25 +01:00
font-weight: 600;
}
</style>
<script>
export default {
helpers: {
2018-04-20 06:38:01 +02:00
getCurrentClass (page, name) {
return page === name ? 'selected' : ''
2018-01-13 19:53:25 +01:00
},
2018-04-20 06:38:01 +02:00
getAriaLabel (page, name, label) {
2018-01-21 10:19:28 +01:00
return page === name ? `${label} (current page)` : label
2018-01-13 19:53:25 +01:00
}
}
}
</script>