mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-30 03:38:54 +01:00
docs(ComponentExample): add iframeMobile prop
This commit is contained in:
@@ -11,6 +11,11 @@ const props = withDefaults(defineProps<{
|
|||||||
* @defaultValue false
|
* @defaultValue false
|
||||||
*/
|
*/
|
||||||
iframe?: boolean | { [key: string]: any }
|
iframe?: boolean | { [key: string]: any }
|
||||||
|
/**
|
||||||
|
* Whether to display the component in a mobile-sized iframe viewport
|
||||||
|
* @defaultValue false
|
||||||
|
*/
|
||||||
|
iframeMobile?: boolean
|
||||||
props?: { [key: string]: any }
|
props?: { [key: string]: any }
|
||||||
/**
|
/**
|
||||||
* Whether to format the code with Prettier
|
* Whether to format the code with Prettier
|
||||||
@@ -189,8 +194,8 @@ const urlSearchParams = computed(() => new URLSearchParams({ ...optionsValues.va
|
|||||||
v-if="iframe"
|
v-if="iframe"
|
||||||
v-bind="typeof iframe === 'object' ? iframe : {}"
|
v-bind="typeof iframe === 'object' ? iframe : {}"
|
||||||
:src="`/examples/${name}?${urlSearchParams}`"
|
:src="`/examples/${name}?${urlSearchParams}`"
|
||||||
class="relative w-full lg:left-1/2 lg:-translate-x-1/2 lg:w-[1024px]"
|
class="relative w-full"
|
||||||
:class="props.class"
|
:class="[props.class, !iframeMobile && 'lg:left-1/2 lg:-translate-x-1/2 lg:w-[1024px]']"
|
||||||
/>
|
/>
|
||||||
<div v-else class="flex justify-center p-4" :class="props.class">
|
<div v-else class="flex justify-center p-4" :class="props.class">
|
||||||
<component :is="camelName" v-bind="{ ...componentProps, ...optionsValues }" />
|
<component :is="camelName" v-bind="{ ...componentProps, ...optionsValues }" />
|
||||||
|
|||||||
Reference in New Issue
Block a user