liveh5-nuxt/app/components/x-button/index.vue
xingyy 331b4a73b2 refactor(app): 重构 LiveRoom 组件
- 将 LiveRoom 相关组件和文件重命名,统一使用小写开头
- 新增 x-button、x-image 和 x-popup 组件,替代原有 PressableButton 和 ImagePreview
-优化 SideButton 组件,使用新的 x-button 和 tangPopup 组件- 更新 LiveRoom 组件中的引用和使用方式
- 调整 tangPopup 组件,使用 goodStore 替代静态数据
2025-01-22 15:44:50 +08:00

28 lines
529 B
Vue

<script setup>
import {ref, defineEmits} from "vue";
const emit = defineEmits(["click"]);
const isButtonActive = ref(false);
const handleButtonPress = () => {
isButtonActive.value = true;
};
const handleButtonRelease = () => {
isButtonActive.value = false;
emit("click")
};
</script>
<template>
<div
:class="[
'transition-all duration-200',
isButtonActive ? 'scale-95' : ''
]"
@touchstart="handleButtonPress"
@touchend="handleButtonRelease"
>
<slot></slot>
</div>
</template>