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

View File

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

View File

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