Skip to content

Commit 05b9bf9

Browse files
committed
fix(playground): add function to open github
1 parent a0e7dc3 commit 05b9bf9

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/sfc-playground/src/Header.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ async function copyLink() {
4141
alert('Sharable URL has been copied to clipboard.')
4242
}
4343
44+
function openGithub() {
45+
window.open('https://github.com/vuejs/core/tree/main/packages/sfc-playground', '_blank')
46+
}
47+
4448
function toggleDark() {
4549
const cls = document.documentElement.classList
4650
cls.toggle('dark')
@@ -149,13 +153,8 @@ async function fetchVersions(): Promise<string[]> {
149153
>
150154
<Download />
151155
</button>
152-
<button title="View on GitHub" class="github">
153-
<a
154-
href="https://github.com/vuejs/core/tree/main/packages/sfc-playground"
155-
target="_blank"
156-
>
157-
<GitHub />
158-
</a>
156+
<button title="View on GitHub" class="github" @click="openGithub">
157+
<GitHub />
159158
</button>
160159
</div>
161160
</nav>

0 commit comments

Comments
 (0)