2024-07-14 19:29:43 +08:00

32 lines
739 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="dc-page">
<div class="my-page">
<div class="title">自定义节流指令连续点击按钮每间隔1s执行一次</div>
<div class="button-box">
<a-button type="primary" style="width: 100px" v-throttle="onClick">1s节流</a-button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { Message } from "@arco-design/web-vue";
const onClick = () => {
Message.success("节流执行了");
};
</script>
<style lang="scss" scoped>
.title {
text-align: center;
color: $color-text-1;
font-size: $font-size-title-1;
}
.button-box {
height: 100px;
display: flex;
justify-content: center;
align-items: center;
}
</style>