i want to add dynamic SVG code to my <template> but without passing it to v-html or without any wrapper around it.
Because the end result should be something like this, and as far as u know template doesn't support v-html. But still if there's way to achieve this Result with v-html or any work around then it would be perfect.
<template>
<svg>
</svg>
<template>
My code looks like this.
<template>
<div>
<span v-html="svgData"></span>
</div>
</template>
<script setup lang="ts">
import { computed } from "vue";
import type { mainIcon } from "tester";
import { completeDataSet } from "tester";
const props = defineProps<{
icon: mainIcon;
}>();
const iconPassed = completeDataSet.find((item) => item.name === props.icon);
const svgData = computed(() => iconPassed?.data);
</script>
Note: I am getting SVG as a String data returned by 3rd party Library. Which is why i cannot make changes to SVG Structure.
Thanks in Advance.