fix IsAnonymous

This commit is contained in:
2023-12-19 21:27:47 +08:00
parent 971af73e19
commit 0dcc8c5912
9 changed files with 192 additions and 47 deletions

View File

@@ -1,6 +1,7 @@
<script lang="ts" setup>
import { isDarkMode } from '@/Utils'
import { UserInfo } from '@/api/api-models'
import { TemplateConfig } from '@/data/VTsuruTypes'
import { NAvatar, NButton, NDivider, NSpace, NText } from 'naive-ui'
const width = window.innerWidth
@@ -13,6 +14,37 @@ const props = defineProps<{
function navigate(url: string) {
window.open(url, '_blank')
}
defineExpose({ Config, DefaultConfig })
</script>
<script lang="ts">
export type ConfigType = {
cover: string
}
export const DefaultConfig = {} as ConfigType
export const Config: TemplateConfig<ConfigType> = {
name: 'Template.Index.Simple',
items: [
{
name: '封面',
type: 'image',
imageLimit: 1,
onUploaded: (url, config) => {
config.cover = url instanceof String ? (url as string) : url[0]
},
},
{
name: 'test',
type: 'string',
data: {
get: (d) => d.cover,
set: (d, v) => {
d.cover = v
},
},
},
],
}
</script>
<template>

View File

@@ -15,25 +15,27 @@ function navigate(url: string) {
}
</script>
<script>
export type SimpleIndexConfig = {
<script lang="ts">
export type ConfigType = {
cover?: string
}
export const Config: TemplateConfig<SimpleIndexConfig> = {
export const Config: TemplateConfig<ConfigType> = {
name: 'Template.Index.Simple',
items: [
{
name: '封面',
type: 'image',
imageLimit: 1,
onUploaded: (url, config) => {config.cover = (url instanceof String ? url as string : url[0])}
onUploaded: (url, config) => {
config.cover = url instanceof String ? (url as string) : url[0]
},
},
{
name: 'test',
type: 'default',
render: (config) => h('div', '1')
}
]
type: 'render',
render: (config) => h('div', '1'),
},
],
}
</script>