import { is } from '@babel/types'; import { ComponentModel } from './cykLang' import { ref } from 'vue'; export function useCykField(props: { componentArg: ComponentModel | undefined }) { const slots = ref(new Map()); props.componentArg?.objectData?.tag.childs.forEach((child) => { if (child.name === 'TEMPLATE') { slots.value.set(child.attributes.NAME, child.getText()); } }); const isLoading = ref(true) const doLoading = async () => { try { if (props.componentArg === undefined) return; await props.componentArg.interpolateAttributes() } catch (err) { throw err } finally { isLoading.value = false } } doLoading() return { isLoading, slots }; }