mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-28 19:00:35 +01:00
docs(ComponentExample): improve iframe display
This commit is contained in:
@@ -181,9 +181,16 @@ const urlSearchParams = computed(() => new URLSearchParams({ ...optionsValues.va
|
|||||||
</UFormField>
|
</UFormField>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-center p-4" :class="props.class">
|
<iframe
|
||||||
<iframe v-if="iframe" v-bind="typeof iframe === 'object' ? iframe : {}" :src="`/examples/${name}?${urlSearchParams}`" class="w-full" />
|
v-if="iframe"
|
||||||
<component :is="camelName" v-else v-bind="{ ...componentProps, ...optionsValues }" />
|
v-bind="typeof iframe === 'object' ? iframe : {}"
|
||||||
|
:src="`/examples/${name}?${urlSearchParams}`"
|
||||||
|
width="1024"
|
||||||
|
class="relative left-1/2 -translate-x-1/2"
|
||||||
|
:class="props.class"
|
||||||
|
/>
|
||||||
|
<div v-else class="flex justify-center p-4" :class="props.class">
|
||||||
|
<component :is="camelName" v-bind="{ ...componentProps, ...optionsValues }" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -5,7 +5,13 @@ const name = route.params.slug?.[0]
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="flex flex-col justify-center items-center h-screen">
|
<div class="example flex flex-col justify-center items-center h-screen">
|
||||||
<component :is="name" v-bind="route.query" />
|
<component :is="name" v-bind="route.query" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.example {
|
||||||
|
--ui-container: 54rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user