Skip to content

Commit

Permalink
delay initial render
Browse files Browse the repository at this point in the history
  • Loading branch information
InventivetalentDev committed Dec 5, 2023
1 parent 887b3b3 commit 04f8479
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/components/Model.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ const recreate = async () => {
};
onMounted(() => {
recreate();
setTimeout(() => {
recreate();
}, 100 * Math.random());
watch(() => props.grid, () => {
console.log("hi")
recreate();
Expand Down
10 changes: 6 additions & 4 deletions src/components/Skin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<div class="skin-container" ref="skinContainer"/>
</template>
<script lang="ts" setup>
import { AssetKey, AssetLoader, Models, Renderer, Skins, sleep } from "minerender";
import { OrbitControls } from "minerender/src/three/OrbitControls";
import { onMounted, ref, watch } from "vue";
import {AssetKey, AssetLoader, Models, Renderer, Skins, sleep} from "minerender";
import {OrbitControls} from "minerender/src/three/OrbitControls";
import {onMounted, ref, watch} from "vue";
const props = defineProps<{
skin: string,
Expand Down Expand Up @@ -78,7 +78,9 @@ const recreate = async () => {
onMounted(async () => {
console.log("onMounted");
recreate();
setTimeout(() => {
recreate();
}, 100 * Math.random());
watch(() => props.grid, () => {
recreate();
})
Expand Down

0 comments on commit 04f8479

Please sign in to comment.