Tuesday, 24 September 2019

How to pass html template as props to Vue component

I have a textarea component that include html tag and I want to get html in edit mode in this component. I use Laravel to generate html.

<template>
    <div>
        <textarea
                  :value="content"
                  :name="name"
                  :id="id">
              <slot></slot>
        </textarea>
    </div>
</template>

In blade page I used to this component:

<my-component>
   <p class="textbox">hello world</p>
</my-component>

when I put this component in page show me tag <slot></slot> in textarea. What should I do? Do you have any solution for my need?

thanks



from How to pass html template as props to Vue component

No comments:

Post a Comment