<template>
    <up-action-sheet
        :actions="actions"
        :title="title"
        :description="description"
        :cancelText="cancelText"
        :round="round"
        :show="show"
        :closeOnClickAction="true"
        :closeOnClickOverlay="true"
        @select="handleSelect"
        @close="handleClose"
    ></up-action-sheet>
</template>

<script setup>
import { ref } from 'vue'

const show = ref(false)
const es = defineEmits(['select', 'close'])
const ps = defineProps({
    actions: {
        type: Array,
        default: () => {
            return []
        }
    },
    title: {
        type: String,
        default: ''
    },
    description: {
        type: String,
        default: ''
    },
    cancelText: {
        type: String,
        default: '取消'
    },
    round: {
        type: [String, Number],
        default: 10
    }
})
const open = () => {
    show.value = true
}
const handleSelect = (data) => {
    show.value = false
    es('select', data)
}
const handleClose = () => {
    show.value = false
    es('close')
}
defineExpose({
    open
})
</script>
<style lang="scss" scoped></style>
