mirror of
https://github.com/vuejs/awesome-vue.git
synced 2025-02-17 15:35:27 -05:00
Better GitHub repo regex
This commit is contained in:
parent
24861974bf
commit
bd6a9fde01
2 changed files with 2 additions and 3 deletions
|
@ -3,8 +3,7 @@
|
||||||
<h1 class="thin">Explore</h1>
|
<h1 class="thin">Explore</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="tag in coolStuff">
|
<li v-for="tag in coolStuff">
|
||||||
<a :href="'#' + tag"
|
<a :href="'#' + tag" @click="filterByTag(tag)">{{ tag }}</a>
|
||||||
@click="filterByTag(tag)">{{ tag }}</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -34,7 +34,7 @@ export default {
|
||||||
* @return {String|null}
|
* @return {String|null}
|
||||||
*/
|
*/
|
||||||
githubBadgeUrl() {
|
githubBadgeUrl() {
|
||||||
const re = /https?:\/\/github\.com\/([A-Za-z0-9-_]*)\/([A-Za-z0-9-_]*)\/?$/i
|
const re = /https?:\/\/github\.com\/([A-Za-z0-9-_\.]*)\/([A-Za-z0-9-_\.]*)\/?$/i
|
||||||
const matches = re.exec(this.item.url)
|
const matches = re.exec(this.item.url)
|
||||||
return matches
|
return matches
|
||||||
? `https://img.shields.io/github/stars/${matches[1]}/${matches[2]}.svg?style=social&label=★`
|
? `https://img.shields.io/github/stars/${matches[1]}/${matches[2]}.svg?style=social&label=★`
|
||||||
|
|
Loading…
Add table
Reference in a new issue