修复编辑模式进入组件报错的问题

This commit is contained in:
陈梓阳 2025-06-13 17:17:20 +08:00
parent e369ebe87b
commit c5f97495e8
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "material-editor", "name": "material-editor",
"private": true, "private": true,
"version": "1.0.30", "version": "1.0.31",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@ -200,7 +200,7 @@ const uploading = ref(false);
// }); // });
const materialInfo = reactive({ const materialInfo = reactive({
dirId: DirectoryId.MaterialDir, // 2 dirId: DirectoryId.MaterialDir, // 2
materialName: props.name || Textures.value?.[0].name || '材质', materialName: props.name || Textures.value[0]?.name || '材质',
inputText: '', inputText: '',
}); });
@ -210,7 +210,7 @@ watch(Textures, async (val) => {
}); });
watch(() => props.name, () => { watch(() => props.name, () => {
materialInfo.materialName = props.name || Textures.value?.[0].name || '材质'; materialInfo.materialName = props.name || Textures.value[0]?.name || '材质';
}); });
watch(textureAdjustment, async (val) => { watch(textureAdjustment, async (val) => {