You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import type { FormType, GalleryType, GridType, KanbanType, TableType } from 'nocodb-sdk'
|
|
|
|
import type { Ref } from 'vue'
|
|
|
|
import { useNuxtApp } from '#app'
|
|
|
|
|
|
|
|
export default function (meta: Ref<TableType>) {
|
|
|
|
const views = ref<Array<GridType | FormType | KanbanType | GalleryType>>()
|
|
|
|
const { $api } = useNuxtApp()
|
|
|
|
|
|
|
|
const loadViews = async () => {
|
|
|
|
if (meta.value?.id)
|
|
|
|
views.value = (await $api.dbView.list(meta.value?.id)).list as Array<GridType | FormType | KanbanType | GalleryType>
|
|
|
|
}
|
|
|
|
|
|
|
|
return { views, loadViews }
|
|
|
|
}
|