Browse Source

fix(gui-v2): teleport warning on shared view form

pull/3300/head
braks 2 years ago
parent
commit
6a2ccfd693
  1. 5
      packages/nc-gui-v2/components/cell/Text.vue
  2. 12
      packages/nc-gui-v2/layouts/default.vue
  3. 1
      packages/nc-gui-v2/nuxt-shim.d.ts
  4. 3
      packages/nc-gui-v2/pages/[projectType]/form/[viewId].vue

5
packages/nc-gui-v2/components/cell/Text.vue

@ -1,10 +1,9 @@
<script setup lang="ts"> <script setup lang="ts">
import type { VNodeRef } from '@vue/runtime-core' import type { VNodeRef } from '@vue/runtime-core'
import { inject } from '#imports' import { EditModeInj, inject, useVModel } from '#imports'
import { EditModeInj } from '~/context'
interface Props { interface Props {
modelValue: string | null | undefined modelValue?: string | null
} }
const props = defineProps<Props>() const props = defineProps<Props>()

12
packages/nc-gui-v2/layouts/default.vue

@ -1,14 +1,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useI18n } from 'vue-i18n' import { useTitle } from '@vueuse/core'
import { useHead, useRoute } from '#imports' import { useI18n, useRoute, useSidebar } from '#imports'
const route = useRoute() const route = useRoute()
const { te, t } = useI18n() const { te, t } = useI18n()
useHead({ const { hasSidebar } = useSidebar()
title: route.meta?.title && te(route.meta.title as string) ? `${t(route.meta.title as string)} | NocoDB` : 'NocoDB',
}) useTitle(route.meta?.title && te(route.meta.title) ? `${t(route.meta.title)} | NocoDB` : 'NocoDB')
</script> </script>
<script lang="ts"> <script lang="ts">
@ -19,7 +19,7 @@ export default {
<template> <template>
<div class="w-full h-full"> <div class="w-full h-full">
<Teleport to="#nc-sidebar-left"> <Teleport :to="hasSidebar ? '#nc-sidebar-left' : null" :disabled="!hasSidebar">
<slot name="sidebar" /> <slot name="sidebar" />
</Teleport> </Teleport>

1
packages/nc-gui-v2/nuxt-shim.d.ts vendored

@ -30,5 +30,6 @@ declare module 'vue-router' {
requiresAuth?: boolean requiresAuth?: boolean
public?: boolean public?: boolean
hideHeader?: boolean hideHeader?: boolean
title?: string
} }
} }

3
packages/nc-gui-v2/pages/[projectType]/form/[viewId].vue

@ -13,12 +13,15 @@ import {
useProvideSharedFormStore, useProvideSharedFormStore,
useProvideSmartsheetStore, useProvideSmartsheetStore,
useRoute, useRoute,
useSidebar,
} from '#imports' } from '#imports'
definePageMeta({ definePageMeta({
public: true, public: true,
}) })
useSidebar({ hasSidebar: false })
const route = useRoute() const route = useRoute()
const { loadSharedView, sharedView, meta, notFound } = useProvideSharedFormStore(route.params.viewId as string) const { loadSharedView, sharedView, meta, notFound } = useProvideSharedFormStore(route.params.viewId as string)

Loading…
Cancel
Save