This commit is contained in:
2023-01-24 15:13:03 +10:00
parent decf5c7d39
commit 4c83399d4a
261 changed files with 33538 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
<template>
<component :is="parsedContent"></component>
</template>
<script setup lang="ts">
import { computed } from "vue";
const props = defineProps({
html: {
type: String,
default: "",
required: true,
},
});
const parsedContent = computed(() => {
let html = "";
const regex = new RegExp(
`<a ([^>]*?)href="${import.meta.env.APP_URL}(.*?>.*?)</a>`,
"ig"
);
html = props.html.replaceAll(regex, '<router-link $1to="$2</router-link>');
return {
template: `<div class="content">${html}</div>`,
};
});
</script>