添加登录功能

This commit is contained in:
xuyue committed 2025-02-28 16:20:58 +08:00
1 parent 81706fc48d
commit 28abe1b429
13 files changed
+181 -14

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
import { useStorage } from "@vueuse/core"
const defaultHTML = `<div class="welcome">黄岩一职</div>`
const defaultCSS = `.welcome {
color: red;
font-size: 24px;
}`
export const html = useStorage("web-html", defaultHTML)
export const css = useStorage("web-css", defaultCSS)
export const js = useStorage("web-js", "")
export const tab = useStorage("web-tab", "html")
export const size = useStorage("web-fontsize", 24)
export function reset(lang: "html" | "css" | "js") {
if (lang === "html") {
html.value = defaultHTML
} else if (lang === "css") {
css.value = defaultCSS
} else {
js.value = ""
}
}
+3
View File
@@ -0,0 +1,3 @@
import { ref } from "vue";
export const loginModal = ref(false)
+4
View File
@@ -0,0 +1,4 @@
import { computed, ref } from "vue"
export const username = ref("")
export const authed = computed(() => !!username.value)