修复编辑模式传入的材质名失效的问题

This commit is contained in:
陈梓阳 2025-06-04 17:12:07 +08:00
parent 07565d42c4
commit 10d5595fb6
2 changed files with 6 additions and 2 deletions

View File

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

View File

@ -108,7 +108,7 @@
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
import { ref, reactive, watch } from "vue" import { ref, reactive, watch, computed } from "vue"
import { useScene, type TextureAdjustment } from "../stores/sceneStore"; import { useScene, type TextureAdjustment } from "../stores/sceneStore";
import CfFlex from "./CfFlex.vue"; import CfFlex from "./CfFlex.vue";
import { DirectoryId } from "../api/Request"; import { DirectoryId } from "../api/Request";
@ -169,6 +169,10 @@ watch(() => props.textureSrcList, async (val) => {
await scene.ChangeTextureFromUrlAsync(_textureSrc.value[0]); await scene.ChangeTextureFromUrlAsync(_textureSrc.value[0]);
}); });
watch(() => props.name, () => {
materialInfo.materialName = props.name || '材质';
});
watch(textureAdjustment, async (val) => { watch(textureAdjustment, async (val) => {
UpdateTexture(); UpdateTexture();
}, { deep: true }); }, { deep: true });