[Vuejs]-How do I render components generated from a string inside of a method?

0👍

what you need to do is make that chat bubble a component that gets dynamically rendered and you can put your <item :id="5"></item> component inside of it, try this,

<template>
  <div>
     <span :is="dynamiChatBubble">
  </div>
</template>
<script>
export default {
  computed: {
    dynamiChatBubble () {
        return {
           template : '<div>You Messeage <item :id="5"></item> bla bla</div>'
        }
    }
  },
}
</script>

make sure you have registered the item component name globally. hope this helps

Leave a comment