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

@@ -7,7 +7,7 @@
</template>
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount } from 'vue';
import { onMounted, onBeforeUnmount, useTemplateRef } from 'vue';
interface NoiseProps {
patternRefreshInterval?: number;
@@ -21,7 +21,7 @@ const props = withDefaults(defineProps<NoiseProps>(), {
mixBlendMode: 'normal'
});
const grainRef = ref<HTMLCanvasElement | null>(null);
const grainRef = useTemplateRef<HTMLCanvasElement>('grainRef');
let animationId = 0;
let frame = 0;