I've been attempting to render a component from a string without success. Here are my codes:
<template>
<div v-html="beautifyNotification(notification)"></div>
</template>
<script>
import { Link } from '@inertiajs/inertia-vue3'
import {compile,h} from "vue"
export default {
components: {
},
props: {
notifications: Object
},
methods: {
beautifyNotification (ntfction) {
return h(compile(`<Link :href="`+ntfction.from.username+`"
class="h6 notification-friend">`+ntfction.from.name+`
</Link>, commented on your new
<Link href="#" class="notification-link">profile status</Link>.`))
},
}
}
</script>
I attempted to render the component using h and compile but it resulted in object object