| | |
| | | </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(""); |