mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
21 lines
446 B
TypeScript
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}
|
|
`;
|
|
};
|