add emoji for mobile
This commit is contained in:
@@ -1,19 +1,17 @@
|
||||
<script lang="ts" setup>
|
||||
import { onUnmounted, computed } from "vue"
|
||||
import { EditorView } from "@codemirror/view"
|
||||
import { whenever } from "@vueuse/core"
|
||||
import { useThemeVars } from "naive-ui"
|
||||
import CodeEditor from "../components/CodeEditor.vue"
|
||||
import ThemeButton from "../components/ThemeButton.vue"
|
||||
import SelectLanguage from "../components/SelectLanguage.vue"
|
||||
import Helper from "./Helper.vue"
|
||||
import { code, input, output, size, status } from "../composables/code"
|
||||
import { Status } from "../types"
|
||||
import { tab } from "../composables/tab"
|
||||
import { Tab } from "../types"
|
||||
import ThemeButton from "../components/ThemeButton.vue"
|
||||
import SelectLanguage from "../components/SelectLanguage.vue"
|
||||
import Helper from "./Helper.vue"
|
||||
import { useThemeVars } from "naive-ui"
|
||||
import { computed } from "vue"
|
||||
import { EditorView } from "@codemirror/view"
|
||||
import { insertText } from "../composables/helper"
|
||||
import { whenever } from "@vueuse/core"
|
||||
import { onUnmounted } from "vue"
|
||||
import { watch } from "vue"
|
||||
|
||||
let codeEditor: EditorView | null = null
|
||||
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
<script lang="ts" setup>
|
||||
import { useMessage, type DropdownOption } from "naive-ui"
|
||||
import { random } from "node-emoji"
|
||||
import { onMounted, ref } from "vue"
|
||||
import { useIntervalFn } from "@vueuse/core"
|
||||
import { code, loading, reset, run } from "../composables/code"
|
||||
import { tab } from "../composables/tab"
|
||||
import copyTextToClipboard from "copy-text-to-clipboard"
|
||||
|
||||
const emoji = ref("")
|
||||
|
||||
function getRandomEmoji() {
|
||||
emoji.value = random().emoji
|
||||
}
|
||||
|
||||
const message = useMessage()
|
||||
function switchAndRun() {
|
||||
tab.value = "output"
|
||||
@@ -19,11 +28,14 @@ const menu: DropdownOption[] = [
|
||||
{ label: "复制", key: "copy", props: { onClick: copy } },
|
||||
{ label: "重置", key: "reset", props: { onClick: reset } },
|
||||
]
|
||||
|
||||
onMounted(getRandomEmoji)
|
||||
useIntervalFn(getRandomEmoji, 5000, { immediate: true })
|
||||
</script>
|
||||
<template>
|
||||
<n-layout-header class="container" bordered>
|
||||
<n-flex justify="space-between" align="center">
|
||||
<div class="title">徐越的自测猫</div>
|
||||
<div @click="getRandomEmoji" class="title">徐越的自测猫 {{ emoji }}</div>
|
||||
<n-flex align="center">
|
||||
<n-dropdown :options="menu">
|
||||
<n-button>操作</n-button>
|
||||
|
||||
Reference in New Issue
Block a user