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">
import type { VNodeRef } from '@vue/runtime-core'
import { inject } from '#imports'
import { EditModeInj } from '~/context'
import { EditModeInj, inject, useVModel } from '#imports'
interface Props {
modelValue: string | null | undefined
modelValue?: string | null
}
const props = defineProps<Props>()

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

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

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

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

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

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

Loading…
Cancel
Save