refactor(sfc-playground): add vapor name

This commit is contained in:
三咲智子 Kevin Deng 2024-05-01 12:29:24 +09:00
parent 69580515d9
commit 1ec90db776
No known key found for this signature in database
3 changed files with 7 additions and 4 deletions

View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg" href="/logo.svg" />
<title>Vue SFC Playground</title>
<title>Vue Vapor SFC Playground</title>
<script>
const savedPreferDark = localStorage.getItem('vue-sfc-playground-prefer-dark')
if (

View File

@ -68,7 +68,7 @@ function toggleDark() {
<nav>
<h1>
<img alt="logo" src="/logo.svg" />
<span>Vue SFC Playground</span>
<span>Vue Vapor SFC Playground</span>
</h1>
<div class="links">
<VersionSelect

View File

@ -1,12 +1,15 @@
<script setup>
<script setup lang="ts">
import { ref, getCurrentInstance } from 'vue'
const msg = ref('Hello World!')
// @ts-expect-error
const isVapor = getCurrentInstance().vapor
</script>
<template>
<h1>{{ msg }}</h1>
<p>
VAPOR <b>{{ isVapor ? 'ON' : 'OFF' }}</b>
</p>
<input v-model="msg" />
<b>VAPOR {{ isVapor ? 'ON' : 'OFF' }}</b>
</template>