<template>
  <view>
    <up-action-sheet
    :round="14"
      :actions="list"
      :title="title"
      :show="show"
      closeOnClickAction
      cancelText="取消"
      @close="close"
      @select="sheetSelect"
    ></up-action-sheet>
  </view>
</template>

<script setup >
import { ref, reactive, onMounted } from "vue";
import { getShopList } from "@/http/api/shop.js";

const props = defineProps({
  title: {
    type: String,
    default: "请选择",
  },
});
const list = ref([]);
const show=defineModel({
    name: "show",
    default: false,
})
function close() {
  show.value = false;
}

const emit=defineEmits(["choose"]);
function sheetSelect(e) {
    console.log(e);
    emit("choose", e);
}
onMounted(() => {
  getShopList().then((res) => {
    list.value = res.map((v) => ({
    ...v,
      value: v.shopId,
      name: v.shopName,
    }));
  });
});
</script>