mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-24 17:00:36 +01:00
chore(example): dynamic editor
This commit is contained in:
@@ -1,36 +1,53 @@
|
||||
<template>
|
||||
<div class="mx-auto max-w-7xl flex flex-col">
|
||||
Welcome
|
||||
<UButton class="ml-3" variant="primary" icon="mdi:bed-single">
|
||||
toto
|
||||
</UButton>
|
||||
<div class="h-full bg-tw-gray-50 min-h-screen">
|
||||
<UContainer class="py-8">
|
||||
<div class="lg:grid lg:grid-cols-12 lg:gap-10 lg:relative">
|
||||
<aside class="pb-8 lg:pb-0 lg:sticky lg:top-0 px-4 sm:px-6 lg:px-0 lg:pt-8 lg:-mt-8 lg:self-start lg:col-span-3" style="position: sticky;">
|
||||
<nav class="space-y-3">
|
||||
<div class="font-bold text-lg pb-6">
|
||||
@nuxthq/ui
|
||||
</div>
|
||||
|
||||
<UIcon name="mdi:bullhorn" class="w-4 h-4 text-black" />
|
||||
<ULink
|
||||
v-for="component in components"
|
||||
:key="component.name"
|
||||
:to="component.to"
|
||||
class="text-sm font-medium block w-full"
|
||||
active-class="text-primary-600"
|
||||
inactive-class="text-tw-gray-900"
|
||||
>
|
||||
{{ component.name }}
|
||||
</ULink>
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<UAvatar class="ml-3" src="https://picsum.photos/200/300" />
|
||||
|
||||
<UButton @click="toggleModalIsOpen()">
|
||||
Toggle modal!
|
||||
</UButton>
|
||||
|
||||
{{ isModalOpen }}
|
||||
|
||||
<UModal v-model="isModalOpen" title="Modal">
|
||||
Body
|
||||
</UModal>
|
||||
|
||||
<!-- <UPopover v-slot="{ open }">
|
||||
<UButton trailing variant="white" :icon="open ? 'heroicons-outline:chevron-up' : 'heroicons-outline:chevron-down'">
|
||||
toto
|
||||
</UButton>
|
||||
</UPopover> -->
|
||||
<div class="space-y-6 sm:px-6 lg:px-0 lg:col-span-9">
|
||||
<NuxtPage />
|
||||
</div>
|
||||
</div>
|
||||
</UContainer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const isModalOpen = ref(false)
|
||||
useMeta({
|
||||
meta: [
|
||||
{ name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1' }
|
||||
],
|
||||
htmlAttrs: {
|
||||
class: 'bg-tw-gray-50'
|
||||
}
|
||||
})
|
||||
|
||||
function toggleModalIsOpen () {
|
||||
isModalOpen.value = !isModalOpen.value
|
||||
}
|
||||
const components = [
|
||||
{ name: 'Avatar', to: '/Avatar' },
|
||||
{ name: 'Button', to: '/Button' },
|
||||
{ name: 'Badge', to: '/Badge' },
|
||||
{ name: 'Dropdown', to: '/Dropdown' },
|
||||
{ name: 'Icon', to: '/Icon' },
|
||||
{ name: 'Toggle', to: '/Toggle' },
|
||||
{ name: 'Card', to: '/Card' },
|
||||
{ name: 'Modal', to: '/Modal' },
|
||||
{ name: 'Select', to: '/Select' }
|
||||
]
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user