mirror of
https://github.com/keven1024/015.git
synced 2026-06-07 12:54:34 +00:00
Compare commits
4 Commits
0.11.0-rc.
...
0.11.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1e956ad4c | ||
|
|
7793bef944 | ||
|
|
1fdd05f0ea | ||
|
|
7128a8c329 |
@@ -21,6 +21,7 @@ const { t } = useI18n()
|
||||
const { createFileShare } = useMyAppShare()
|
||||
const { data } = useQuery({
|
||||
queryKey: ['create-share', ...props?.data?.files?.map((item) => item.id)],
|
||||
staleTime: Infinity,
|
||||
queryFn: async () => {
|
||||
const { files, config } = props?.data || {}
|
||||
const data = await createFileShare({
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Markdown } from 'tiptap-markdown'
|
||||
import Placeholder from '@tiptap/extension-placeholder'
|
||||
import { cx } from 'class-variance-authority'
|
||||
import countWords from '@/lib/countWords'
|
||||
const { t } = useI18n()
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue?: string
|
||||
@@ -64,6 +65,6 @@ onUnmounted(() => {
|
||||
v-if="modelValue?.length && modelValue?.length > 0"
|
||||
class="absolute bottom-2 right-3 flex justify-end px-2 py-1 text-xs text-gray-400 select-none bg-white rounded-md"
|
||||
>
|
||||
{{ `${modelValue?.length ?? 0} 长度 · ${countWords(modelValue ?? '')} 字符` }}
|
||||
{{ `${modelValue?.length ?? 0} ${t('common.length')} · ${countWords(modelValue ?? '')} ${t('common.words')}` }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
43
front/components/ui/sonner/Sonner.vue
Normal file
43
front/components/ui/sonner/Sonner.vue
Normal file
@@ -0,0 +1,43 @@
|
||||
<script lang="ts" setup>
|
||||
import type { ToasterProps } from 'vue-sonner'
|
||||
import 'vue-sonner/style.css'
|
||||
import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon, XIcon } from '@lucide/vue'
|
||||
import { Toaster as Sonner } from 'vue-sonner'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<ToasterProps>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Sonner
|
||||
:class="cn('toaster group', props.class)"
|
||||
:style="{
|
||||
'--normal-bg': 'var(--popover)',
|
||||
'--normal-text': 'var(--popover-foreground)',
|
||||
'--normal-border': 'var(--border)',
|
||||
'--border-radius': 'var(--radius)',
|
||||
}"
|
||||
v-bind="props"
|
||||
>
|
||||
<template #success-icon>
|
||||
<CircleCheckIcon class="size-4" />
|
||||
</template>
|
||||
<template #info-icon>
|
||||
<InfoIcon class="size-4" />
|
||||
</template>
|
||||
<template #warning-icon>
|
||||
<TriangleAlertIcon class="size-4" />
|
||||
</template>
|
||||
<template #error-icon>
|
||||
<OctagonXIcon class="size-4" />
|
||||
</template>
|
||||
<template #loading-icon>
|
||||
<div>
|
||||
<Loader2Icon class="size-4 animate-spin" />
|
||||
</div>
|
||||
</template>
|
||||
<template #close-icon>
|
||||
<XIcon class="size-4" />
|
||||
</template>
|
||||
</Sonner>
|
||||
</template>
|
||||
1
front/components/ui/sonner/index.ts
Normal file
1
front/components/ui/sonner/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default as Toaster } from './Sonner.vue'
|
||||
@@ -38,7 +38,9 @@
|
||||
},
|
||||
"common": {
|
||||
"add": "Hinzufügen",
|
||||
"copySuccess": "Erfolgreich kopiert"
|
||||
"copySuccess": "Erfolgreich kopiert",
|
||||
"length": "Länge",
|
||||
"words": "Wörter"
|
||||
},
|
||||
"page": {
|
||||
"upload": {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
},
|
||||
"common": {
|
||||
"add": "Add",
|
||||
"copySuccess": "Copy Success"
|
||||
"copySuccess": "Copy Success",
|
||||
"length": "length",
|
||||
"words": "words"
|
||||
},
|
||||
"page": {
|
||||
"upload": {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
},
|
||||
"common": {
|
||||
"add": "Ajouter",
|
||||
"copySuccess": "Copié avec succès"
|
||||
"copySuccess": "Copié avec succès",
|
||||
"length": "longueur",
|
||||
"words": "mots"
|
||||
},
|
||||
"page": {
|
||||
"upload": {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
},
|
||||
"common": {
|
||||
"add": "追加",
|
||||
"copySuccess": "コピーしました"
|
||||
"copySuccess": "コピーしました",
|
||||
"length": "長さ",
|
||||
"words": "文字"
|
||||
},
|
||||
"page": {
|
||||
"upload": {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
},
|
||||
"common": {
|
||||
"add": "추가",
|
||||
"copySuccess": "복사되었습니다"
|
||||
"copySuccess": "복사되었습니다",
|
||||
"length": "길이",
|
||||
"words": "단어"
|
||||
},
|
||||
"page": {
|
||||
"upload": {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
},
|
||||
"common": {
|
||||
"add": "添加",
|
||||
"copySuccess": "复制成功"
|
||||
"copySuccess": "复制成功",
|
||||
"length": "长度",
|
||||
"words": "字符"
|
||||
},
|
||||
"page": {
|
||||
"upload": {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
},
|
||||
"common": {
|
||||
"add": "新增",
|
||||
"copySuccess": "複製成功"
|
||||
"copySuccess": "複製成功",
|
||||
"length": "長度",
|
||||
"words": "字符"
|
||||
},
|
||||
"page": {
|
||||
"upload": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { Toaster } from 'vue-sonner'
|
||||
import { Toaster } from '@/components/ui/sonner'
|
||||
const { locale } = useI18n()
|
||||
await useSeo({ locale: locale.value })
|
||||
const appConfig = useMyAppConfig()
|
||||
|
||||
Reference in New Issue
Block a user