File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 17
17
:style =" gridStyle"
18
18
>
19
19
<Item
20
- v-for =" (item) in sortedItems"
21
- :id =" makeId(title, item.title)"
22
- :key =" makeId(title, item.title)"
20
+ v-for =" (item, index ) in sortedItems"
21
+ :id =" makeId(title, item.title, index )"
22
+ :key =" makeId(title, item.title, index )"
23
23
:url =" item.url"
24
24
:title =" item.title"
25
25
:description =" item.description"
@@ -114,9 +114,10 @@ export default {
114
114
},
115
115
methods: {
116
116
/* Returns a unique lowercase string, based on name, for section ID */
117
- makeId (sectionStr , itemStr ) {
117
+ makeId (sectionStr , itemStr , index ) {
118
118
const charSum = sectionStr .split (' ' ).map ((a ) => a .charCodeAt (0 )).reduce ((x , y ) => x + y);
119
- return ` ${ charSum} _${ itemStr .replace (/ \s + / g , ' -' ).replace (/ [^ a-zA-Z ] / g , ' ' ).toLowerCase ()} ` ;
119
+ const itemTitleStr = itemStr .replace (/ \s + / g , ' -' ).replace (/ [^ a-zA-Z ] / g , ' ' ).toLowerCase ();
120
+ return ` ${ index} _${ charSum} _${ itemTitleStr} ` ;
120
121
},
121
122
/* Opens the iframe modal */
122
123
triggerModal (url ) {
You can’t perform that action at this time.
0 commit comments