MelMacaluso / vue-modal

Reusable Modal component, supports own custom HTML, text and classes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do you customize or change the modal button ? How to call a function on modal button click ?

GeorgeFlorian opened this issue · comments

I am trying to figure out how to customize the modal button.

I know we can change how it looks by using the CSS tag button, but I would like to add much more it.

This is what I would like to have instead of the default button.

<span @click.prevent="editFile(file.id)">
    <i class="far fa-edit"></i>
</span>

I have tried using template literals like this:

    <Modal btnText=`<span @click.prevent="editFile(file.id)">
                    <i class="far fa-edit"></i>
                  </span>`
            :closeBtn="true"
            closeBtnContent="<span>X</span>"
    >
      <Component/>
    </Modal>

but it obviously did not work.

How can we customize the button that opens the modal ?