|
|
@@ -1,6 +1,6 @@
|
|
|
<script setup lang="ts">
|
|
|
import { downloadProject } from './download/download'
|
|
|
-import { setVersion, resetVersion } from './sfcCompiler'
|
|
|
+import { setVersion, resetVersion } from './transform'
|
|
|
import { ref, onMounted } from 'vue'
|
|
|
|
|
|
const currentCommit = __COMMIT__
|
|
|
@@ -44,8 +44,8 @@ async function fetchVersions(): Promise<string[]> {
|
|
|
`https://api.github.com/repos/vuejs/vue-next/releases?per_page=100`
|
|
|
)
|
|
|
const releases: any[] = await res.json()
|
|
|
- const versions = releases.map(
|
|
|
- r => (/^v/.test(r.tag_name) ? r.tag_name.substr(1) : r.tag_name)
|
|
|
+ const versions = releases.map(r =>
|
|
|
+ /^v/.test(r.tag_name) ? r.tag_name.substr(1) : r.tag_name
|
|
|
)
|
|
|
const minVersion = versions.findIndex(v => v === '3.0.10')
|
|
|
return versions.slice(0, minVersion + 1)
|
|
|
@@ -55,7 +55,7 @@ async function fetchVersions(): Promise<string[]> {
|
|
|
<template>
|
|
|
<nav>
|
|
|
<h1>
|
|
|
- <img alt="logo" src="/logo.svg">
|
|
|
+ <img alt="logo" src="/logo.svg" />
|
|
|
<span>Vue SFC Playground</span>
|
|
|
</h1>
|
|
|
<div class="links">
|
|
|
@@ -68,31 +68,61 @@ async function fetchVersions(): Promise<string[]> {
|
|
|
<li v-for="version of publishedVersions">
|
|
|
<a @click="setVueVersion(version)">v{{ version }}</a>
|
|
|
</li>
|
|
|
- <li><a @click="resetVueVersion">This Commit ({{ currentCommit }})</a></li>
|
|
|
<li>
|
|
|
- <a href="https://app.netlify.com/sites/vue-sfc-playground/deploys" target="_blank">Commits History</a>
|
|
|
+ <a @click="resetVueVersion">This Commit ({{ currentCommit }})</a>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <a
|
|
|
+ href="https://app.netlify.com/sites/vue-sfc-playground/deploys"
|
|
|
+ target="_blank"
|
|
|
+ >Commits History</a
|
|
|
+ >
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
<button class="share" @click="copyLink">
|
|
|
<svg width="1.4em" height="1.4em" viewBox="0 0 24 24">
|
|
|
- <g fill="none" stroke="#626262" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
|
- <circle cx="18" cy="5" r="3"/>
|
|
|
- <circle cx="6" cy="12" r="3"/>
|
|
|
- <circle cx="18" cy="19" r="3"/>
|
|
|
- <path d="M8.59 13.51l6.83 3.98"/>
|
|
|
- <path d="M15.41 6.51l-6.82 3.98"/>
|
|
|
+ <g
|
|
|
+ fill="none"
|
|
|
+ stroke="#626262"
|
|
|
+ stroke-width="2"
|
|
|
+ stroke-linecap="round"
|
|
|
+ stroke-linejoin="round"
|
|
|
+ >
|
|
|
+ <circle cx="18" cy="5" r="3" />
|
|
|
+ <circle cx="6" cy="12" r="3" />
|
|
|
+ <circle cx="18" cy="19" r="3" />
|
|
|
+ <path d="M8.59 13.51l6.83 3.98" />
|
|
|
+ <path d="M15.41 6.51l-6.82 3.98" />
|
|
|
</g>
|
|
|
</svg>
|
|
|
- </button>
|
|
|
+ </button>
|
|
|
<button class="download" @click="downloadProject">
|
|
|
<svg width="1.7em" height="1.7em" viewBox="0 0 24 24">
|
|
|
<g fill="#626262">
|
|
|
- <rect x="4" y="18" width="16" height="2" rx="1" ry="1"/>
|
|
|
- <rect x="3" y="17" width="4" height="2" rx="1" ry="1" transform="rotate(-90 5 18)"/>
|
|
|
- <rect x="17" y="17" width="4" height="2" rx="1" ry="1" transform="rotate(-90 19 18)"/>
|
|
|
- <path d="M12 15a1 1 0 0 1-.58-.18l-4-2.82a1 1 0 0 1-.24-1.39a1 1 0 0 1 1.4-.24L12 12.76l3.4-2.56a1 1 0 0 1 1.2 1.6l-4 3a1 1 0 0 1-.6.2z"/>
|
|
|
- <path d="M12 13a1 1 0 0 1-1-1V4a1 1 0 0 1 2 0v8a1 1 0 0 1-1 1z"/>
|
|
|
+ <rect x="4" y="18" width="16" height="2" rx="1" ry="1" />
|
|
|
+ <rect
|
|
|
+ x="3"
|
|
|
+ y="17"
|
|
|
+ width="4"
|
|
|
+ height="2"
|
|
|
+ rx="1"
|
|
|
+ ry="1"
|
|
|
+ transform="rotate(-90 5 18)"
|
|
|
+ />
|
|
|
+ <rect
|
|
|
+ x="17"
|
|
|
+ y="17"
|
|
|
+ width="4"
|
|
|
+ height="2"
|
|
|
+ rx="1"
|
|
|
+ ry="1"
|
|
|
+ transform="rotate(-90 19 18)"
|
|
|
+ />
|
|
|
+ <path
|
|
|
+ d="M12 15a1 1 0 0 1-.58-.18l-4-2.82a1 1 0 0 1-.24-1.39a1 1 0 0 1 1.4-.24L12 12.76l3.4-2.56a1 1 0 0 1 1.2 1.6l-4 3a1 1 0 0 1-.6.2z"
|
|
|
+ />
|
|
|
+ <path d="M12 13a1 1 0 0 1-1-1V4a1 1 0 0 1 2 0v8a1 1 0 0 1-1 1z" />
|
|
|
</g>
|
|
|
</svg>
|
|
|
</button>
|