mirror of
https://github.com/DavidHDev/vue-bits.git
synced 2026-03-09 08:29:30 -06:00
Added useTemplateRef API support
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onUnmounted, watch, type CSSProperties } from 'vue';
|
||||
import { onMounted, onUnmounted, watch, type CSSProperties, useTemplateRef } from 'vue';
|
||||
|
||||
class Grad {
|
||||
x: number;
|
||||
@@ -180,8 +180,8 @@ const props = withDefaults(defineProps<WavesProps>(), {
|
||||
className: ''
|
||||
});
|
||||
|
||||
const containerRef = ref<HTMLDivElement>();
|
||||
const canvasRef = ref<HTMLCanvasElement>();
|
||||
const containerRef = useTemplateRef<HTMLDivElement>('containerRef');
|
||||
const canvasRef = useTemplateRef<HTMLCanvasElement>('canvasRef');
|
||||
|
||||
let ctx: CanvasRenderingContext2D | null = null;
|
||||
let bounding = { width: 0, height: 0, left: 0, top: 0 };
|
||||
|
||||
Reference in New Issue
Block a user