Skip to content

Commit 9ac0dde

Browse files
authored
feat(sfc-playground): add github link (#5067)
1 parent b027507 commit 9ac0dde

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

Diff for: packages/sfc-playground/src/Header.vue

+14-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Sun from './icons/Sun.vue'
55
import Moon from './icons/Moon.vue'
66
import Share from './icons/Share.vue'
77
import Download from './icons/Download.vue'
8+
import GitHub from './icons/GitHub.vue'
89
910
// @ts-ignore
1011
const { store } = defineProps(['store'])
@@ -125,6 +126,17 @@ async function fetchVersions(): Promise<string[]> {
125126
>
126127
<Download />
127128
</button>
129+
<button
130+
title="View on GitHub"
131+
class="github"
132+
>
133+
<a
134+
href="https://github.com/vuejs/vue-next/tree/master/packages/sfc-playground"
135+
target="_blank"
136+
>
137+
<GitHub />
138+
</a>
139+
</button>
128140
</div>
129141
</nav>
130142
</template>
@@ -272,7 +284,8 @@ h1 img {
272284
}
273285
274286
.share,
275-
.download {
287+
.download,
288+
.github {
276289
margin: 0 2px;
277290
}
278291
</style>

Diff for: packages/sfc-playground/src/icons/GitHub.vue

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template>
2+
<svg width="1.7em" height="1.7em" viewBox="0 0 24 24">
3+
<path
4+
fill="#666"
5+
d="M10.9,2.1c-4.6,0.5-8.3,4.2-8.8,8.7c-0.5,4.7,2.2,8.9,6.3,10.5C8.7,21.4,9,21.2,9,20.8v-1.6c0,0-0.4,0.1-0.9,0.1 c-1.4,0-2-1.2-2.1-1.9c-0.1-0.4-0.3-0.7-0.6-1C5.1,16.3,5,16.3,5,16.2C5,16,5.3,16,5.4,16c0.6,0,1.1,0.7,1.3,1c0.5,0.8,1.1,1,1.4,1 c0.4,0,0.7-0.1,0.9-0.2c0.1-0.7,0.4-1.4,1-1.8c-2.3-0.5-4-1.8-4-4c0-1.1,0.5-2.2,1.2-3C7.1,8.8,7,8.3,7,7.6C7,7.2,7,6.6,7.3,6 c0,0,1.4,0,2.8,1.3C10.6,7.1,11.3,7,12,7s1.4,0.1,2,0.3C15.3,6,16.8,6,16.8,6C17,6.6,17,7.2,17,7.6c0,0.8-0.1,1.2-0.2,1.4 c0.7,0.8,1.2,1.8,1.2,3c0,2.2-1.7,3.5-4,4c0.6,0.5,1,1.4,1,2.3v2.6c0,0.3,0.3,0.6,0.7,0.5c3.7-1.5,6.3-5.1,6.3-9.3 C22,6.1,16.9,1.4,10.9,2.1z"></path>
6+
</svg>
7+
</template>

0 commit comments

Comments
 (0)