修复编辑模式进入组件报错的问题
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "material-editor",
|
||||
"private": true,
|
||||
"version": "1.0.29",
|
||||
"version": "1.0.30",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
@@ -205,7 +205,7 @@ const materialInfo = reactive({
|
||||
});
|
||||
|
||||
watch(Textures, async (val) => {
|
||||
if (val.length == 0) return;
|
||||
if (val.length == 0 || props.ignoreTexture) return;
|
||||
await scene.ChangeTextureFromUrlAsync(val[0].src);
|
||||
});
|
||||
|
||||
|
@@ -56,7 +56,7 @@ async function HandleUpdateConfig() {
|
||||
editMode.value = true;
|
||||
}
|
||||
else { editMode.value = false; }
|
||||
if (config.textures) {
|
||||
if (config.textures && config.textures.length > 0) {
|
||||
textures.value = Array.from(config.textures);
|
||||
await scene.ChangeTextureFromUrlAsync(textures.value[0].src); // 这一行是保证首次Mount组件时纹理能够立刻刷新
|
||||
}
|
||||
|
Reference in New Issue
Block a user