mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
fix IsAnonymous
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user