700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > vue3鼠标移入移出

vue3鼠标移入移出

时间:2018-10-04 01:14:27

相关推荐

vue3鼠标移入移出

盒子循环,各过各的,有需求的可在方法中传参

<template> <div style="display: flex"><div v-for="(item, index) in arr" :key="index" style="background-color: greenyellow;"><div @mouseenter="mouseenter" @mouseleave="mouseleave"style="background-color: gray;width: 100px;height: 50px;margin: 20px">{{ index + "下标-------内容" + item }}</div></div></div></template>

<script lang="ts" setup>import { ref } from "vue";const arr = ref([1, 2, 3]);const mouseenter = () => {console.log(1 + "鼠标进入");};const mouseleave = () => {console.log(3 + "鼠标离开");};</script>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。