Files
aurora-admin/site/sources/bottomsheet/vue2.txt
T
aurora-admin c65a69c34e
Deploy to GitHub Pages / deploy (push) Failing after 16s
Regression / regression (push) Failing after 15m2s
feat(P4): precompute移植+app.js sources双向回填+回归1003/1003+验收体积/文件/data.json
2026-09-12 14:18:41 +08:00

25 lines
886 B
Plaintext

<template>
<div class="aa-sheet-mask" :class="{ 'is-open': visible }" @click="$emit('close')"></div>
<div class="aa-sheet" :class="{ 'is-open': visible }"
@pointerdown="onDown" @pointerup="onUp">
<div class="aa-sheet-handle"></div>
<div class="aa-sheet-header" v-if="title">{{ title }}</div>
<div class="aa-sheet-body"><slot>默认内容</slot></div>
<div class="aa-sheet-footer" v-if="$slots.footer"><slot name="footer"></slot></div>
</div>
</template>
<script>
export default {
name: 'AaBottomSheet',
props: { visible: { type: Boolean, default: false }, title: { type: String, default: '' } },
data: function () { return { startY: 0 }; },
methods: {
onDown: function (e) { this.startY = e.clientY; },
onUp: function (e) { if (this.startY - e.clientY < -80) this.$emit('close'); }
}
};
</script>
<style src="./BottomSheet.css"></style>