Files
svgl/src/templates/getVueCode.ts
T
2025-08-21 10:26:07 +01:00

21 lines
446 B
TypeScript

import { parseSvgContent } from "@/utils/parseSvgContent";
interface VueComponentParams {
lang: string;
content: string;
}
export const getVueCode = (params: VueComponentParams) => {
const { templateContent, componentStyle } = parseSvgContent(
params.content,
"Vue",
);
return `<script setup${params.lang ? ` lang="${params.lang}"` : ""}></script>
<template>
${templateContent}
</template>
${componentStyle}
`;
};