guonan
2025-04-15 c62099b5f8753bee49c3fca630e9757b7682a6c1
src/views/left/CitySim.vue
@@ -92,17 +92,20 @@
  </div>
</template>
<script setup>
import { reactive, ref, watch } from "vue";
import { reactive, ref, watch, inject } from "vue";
import { initeWaterPrimitiveView } from "@/utils/water";
const emit = defineEmits(["start", "end"]);
function endPlay() {
  emit("end");
}
// 注入父组件提供的方法
const { startSimulate, endSimulate } = inject("simulateActions");
// const emit = defineEmits(["start", "end"]);
// function endPlay() {
//   emit("end");
// }
function startPlay() {
  initeWaterPrimitiveView();
  emit("start");
  startSimulate();
}
const value = ref("");