vp-api-enum.vue 452 B

1234567891011121314151617181920
  1. <script setup lang="ts">
  2. import { computed } from 'vue'
  3. import { isString } from '@vue/shared'
  4. import ApiTyping from './vp-api-typing.vue'
  5. const props = defineProps({
  6. values: {
  7. type: Array,
  8. required: true,
  9. },
  10. })
  11. const processString = (s: unknown) => (isString(s) ? `'${s}'` : s)
  12. const details = computed(() => props.values.map(processString).join(' | '))
  13. </script>
  14. <template>
  15. <api-typing type="enum" :details="details" />
  16. </template>