vp-api-ref.vue 419 B

123456789101112131415161718192021
  1. <script setup lang="ts">
  2. import { computed } from 'vue'
  3. import ApiTyping from './vp-api-typing.vue'
  4. const props = defineProps({
  5. type: {
  6. type: String,
  7. required: true,
  8. },
  9. shallow: Boolean,
  10. })
  11. const type = computed(() => {
  12. const wrapperType = props.shallow ? 'ShallowRef' : 'Ref'
  13. return `${wrapperType}<${props.type}>`
  14. })
  15. </script>
  16. <template>
  17. <ApiTyping type="Object" :details="type" />
  18. </template>