Skip to content

Commit 5d46c2e

Browse files
authored
fix: Rename skip-link list label prop to list-label (#17)
1 parent df60abf commit 5d46c2e

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ new Vue({
5252
5353
<template>
5454
<div id="app">
55-
<VueSkipTo to="#main" text="Skip to main content" />
55+
<VueSkipTo to="#main" label="Skip to main content" />
5656
5757
<!-- header, navigation, and more -->
5858
@@ -94,7 +94,7 @@ To use multiple links, simply pass an array into the `to` prop with the followin
9494
<template>
9595
<div id="app">
9696
<vue-skip-to
97-
title-list="Skip to"
97+
list-label="Skip to"
9898
:to="[
9999
{ anchor: '#main', label: 'Main content' },
100100
{ anchor: '#footer', label: 'Footer' },
@@ -139,11 +139,11 @@ To use multiple links, simply pass an array into the `to` prop with the followin
139139

140140
## Props
141141

142-
| Prop | Data Type | required | Description | Default |
143-
| ----------- | --------------- | -------- | --------------------------------------------------------------- | ---------------------- |
144-
| `to` | String \| Array | false | Destination ID or [array of destination objects](#skip-to-list) | '#main' |
145-
| `label` | String | false | Skip link text content | 'Skip to main content' |
146-
| `titleList` | String | false | Skip link list label text | 'Skip to' |
142+
| Prop | Data Type | required | Description | Default |
143+
| ------------ | --------------- | -------- | ----------------------------------------------------------------- | ---------------------- |
144+
| `to` | String \| Array | false | Destination ID or [array of destination objects](###skip-to-list) | '#main' |
145+
| `label` | String | false | Skip link text content | 'Skip to main content' |
146+
| `list-label` | String | false | Skip link list label text | 'Skip to' |
147147

148148
## Custom styling
149149

demo/skip-to-list.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@
2020
<div id="app">
2121
<!-- data-vst used for internal testing, it is NOT required -->
2222
<vue-skip-to
23-
title-list="Skip links"
23+
list-label="Skip links"
2424
:to="[
2525
{ anchor: '#main', label: 'Main content' },
2626
{ anchor: '#footer', label: 'Footer' },
2727
]"
2828
data-vst="skip-to-list"
29-
>
30-
Skip links
31-
</vue-skip-to>
29+
></vue-skip-to>
3230

3331
<header>
3432
<h1>Press tab</h1>

src/VueSkipTo.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default {
1212
name: 'VueSkipTo',
1313
1414
props: {
15-
titleList: {
15+
listLabel: {
1616
type: String,
1717
default: 'Skip to'
1818
},
@@ -36,7 +36,7 @@ export default {
3636
},
3737
3838
props () {
39-
if (this.isList) return { titleList: this.titleList, to: this.to }
39+
if (this.isList) return { listLabel: this.listLabel, to: this.to }
4040
return { label: this.label, to: this.to }
4141
}
4242
}

src/VueSkipToList.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<nav class="vue-skip-to__nav">
3-
<span id="list-title">{{ titleList }}</span>
3+
<span id="list-title">{{ listLabel }}</span>
44
<ul class="vue-skip-to__nav-list">
55
<li
66
v-for="el in to"
@@ -11,7 +11,7 @@
1111
>
1212
<VueSkipToSingle
1313
:to="el.anchor"
14-
:aria-label="el.ariaLabel || `${titleList} ${el.label}`"
14+
:aria-label="el.ariaLabel || `${listLabel} ${el.label}`"
1515
>
1616
{{ el.label }}
1717
</VueSkipToSingle>
@@ -27,7 +27,7 @@ export default {
2727
name: 'VueSkipToList',
2828
2929
props: {
30-
titleList: {
30+
listLabel: {
3131
type: String,
3232
default: 'Skip to'
3333
},

0 commit comments

Comments
 (0)