Added useTemplateRef API support

This commit is contained in:
msavulescu
2025-07-18 16:20:35 +03:00
parent 2aad0d4f4c
commit 6af299052a
69 changed files with 157 additions and 158 deletions

View File

@@ -3,7 +3,7 @@
</template>
<script setup lang="ts">
import { ref, watch, onMounted, onUnmounted, type CSSProperties } from 'vue';
import { watch, onMounted, onUnmounted, type CSSProperties, useTemplateRef } from 'vue';
import { Renderer, Program, Mesh, Triangle } from 'ogl';
interface BalatroProps {
@@ -42,7 +42,7 @@ const props = withDefaults(defineProps<BalatroProps>(), {
style: () => ({})
});
const containerRef = ref<HTMLDivElement>();
const containerRef = useTemplateRef<HTMLDivElement>('containerRef');
const hexToVec4 = (hex: string): [number, number, number, number] => {
const hexStr = hex.replace('#', '');