mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-06 18:36:55 +08:00
修复动态表单默认值赋值逻辑
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import { ConfigItemDefinition, TemplateConfigImageItem } from '@/data/VTsuruTypes';
|
||||
import { FILE_BASE_URL, VTSURU_API_URL } from '@/data/constants';
|
||||
import { Info24Filled } from '@vicons/fluent';
|
||||
import { NButton, NCheckbox, NColorPicker, NEmpty, NForm, NFormItem, NGrid, NInput, NInputNumber, NSlider, NTooltip, NUpload, UploadFileInfo, useMessage } from 'naive-ui';
|
||||
import { NButton, NCheckbox, NColorPicker, NEmpty, NForm, NGrid, NInput, NInputNumber, NSlider, NTooltip, NUpload, UploadFileInfo, useMessage } from 'naive-ui';
|
||||
import { onMounted, ref } from 'vue';
|
||||
|
||||
const message = useMessage();
|
||||
@@ -73,7 +73,8 @@ import { Info24Filled } from '@vicons/fluent';
|
||||
function getItems() { }
|
||||
onMounted(() => {
|
||||
props.config?.forEach(item => {
|
||||
if (item.default && !props.configData[item.key]) {
|
||||
console.log(props.configData)
|
||||
if (item.default && !(item.key in props.configData)) {
|
||||
props.configData[item.key] = item.default;
|
||||
}
|
||||
if (item.type == 'image') {
|
||||
|
||||
Reference in New Issue
Block a user