修复场景初始化后纹理未更新的问题

This commit is contained in:
2025-05-30 15:47:17 +08:00
parent 9335c16763
commit 65a3779e1a
6 changed files with 27 additions and 8 deletions

View File

@@ -114,6 +114,7 @@ import CfFlex from "./CfFlex.vue";
import { DirectoryId } from "../api/Request";
import { IsNullOrWhitespace } from "../helpers/helper.string";
import { FromDeflateBase64, ToDeflatedBase64 } from "../helpers/helper.material";
import { AsyncDelay } from "../helpers/helper.async";
export interface MaterialRequest {
/** 材质名 */
@@ -164,10 +165,6 @@ const materialInfo = reactive({
inputText:'',
});
onMounted(async () => {
await scene.ChangeTextureFromUrlAsync(_textureSrc.value[0]);
})
watch(() => props.textureSrcList, async (val) => {
_textureSrc.value = val;
await scene.ChangeTextureFromUrlAsync(_textureSrc.value[0]);

View File

@@ -53,6 +53,7 @@ async function HandleUpdateConfig() {
await scene.ImportMaterialAsync(json);
}
textureSrc.value = Array.from(config.textureSrc);
await scene.ChangeTextureFromUrlAsync(textureSrc.value[0]);
}
</script>