<template>
  <div>
    <template v-for="item in btnList">
      <a-button :color="item.class ? item.class : 'info'" class="ml-2" type="primary"
        @click="emit('btnEvent',item.domId)"> {{item.name}} </a-button>
    </template>
  </div>
</template>
<script lang="ts" setup>
  import { router } from '@/router';
  import { defineEmits } from 'vue'
  const btnList = router.currentRoute.value.meta.elements ?router.currentRoute.value.meta.elements :[]
  btnList.sort((a, b) => {
    return (a.sort || 0) - (b.sort || 0);
  });
  const emit = defineEmits(['btnEvent'])

</script>